Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync Iron with Main for release #2347

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6eebe6c
fix move_group capabilities loading (#2270)
todoubaba Jul 24, 2023
cdf7a98
Specify controller name in MGI execution (#2257)
stephanie-eng Jul 25, 2023
830ceda
Cleanup planning request adapter interface (#2266)
sjahr Jul 27, 2023
5506dd5
Replaced numbers with SystemDefaultsQos() (#2271)
Shobuj-Paul Jul 31, 2023
83892d6
Fix comment formatting (#2276)
stephanie-eng Jul 31, 2023
f9f1804
Remove source install of gtest branch in CI (#2284)
henningkayser Aug 2, 2023
548f5fe
Fix typo in error message (#2286)
stephanie-eng Aug 3, 2023
92ca89d
[Servo] Refactoring servo (#2224)
ibrahiminfinite Aug 7, 2023
4476fb6
[Servo] Add additional info about twist frame conversion (#2295)
ibrahiminfinite Aug 11, 2023
bdc9cec
Replaced boost::algorithm::join with fmt::join (#2273)
Shobuj-Paul Aug 12, 2023
01ccced
Add mergify iron backport label (#2293)
sjahr Aug 14, 2023
3b9de9b
Fix linking error with cached_ik_kinematics_plugin (#2292)
sloretz Aug 10, 2023
d4dcea3
Fx class_loader warnings in PILZ unittests (#2296)
todoubaba Aug 15, 2023
a2f0183
Remove added path index from planner adapter function signature (#2285)
sjahr Aug 15, 2023
7c95367
[TOTG] Exit loop when position can't change (#2307)
uavster Aug 18, 2023
05f3501
Remove boost from motion_planning_rviz_plugin (#2308)
todoubaba Aug 22, 2023
5af8db7
[Servo] Fix Twist transformation (#2311)
ibrahiminfinite Aug 23, 2023
3e5af1b
Remove humble tags from main branch GHA jobs (#2312)
henningkayser Aug 23, 2023
47d92ef
Add a benchmark for 'getJacobian' (#2326)
marioprats Aug 24, 2023
84421ea
🛠️ Bump actions/checkout from 3 to 4 (#2339)
dependabot[bot] Sep 5, 2023
6608798
Merge branch 'iron' into iron-sync
tylerjw Sep 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ pull_request_rules:
branches:
- humble

- name: backport to iron at reviewers discretion
conditions:
- base=main
- "label=backport-iron"
actions:
backport:
branches:
- iron

- name: ask to resolve conflict
conditions:
- conflict
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ jobs:
ROS_DISTRO: iron
IKFAST_TEST: true
CLANG_TIDY: pedantic
- IMAGE: humble-ci
ROS_DISTRO: humble
- IMAGE: humble-ci-testing
ROS_DISTRO: humble
env:
CXXFLAGS: >-
-Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls
Expand Down Expand Up @@ -77,7 +81,7 @@ jobs:
# free up a lot of stuff from /usr/local
sudo rm -rf /usr/local
df -h
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: testspace-com/setup-testspace@v1
if: github.repository == 'ros-planning/moveit2'
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
PUSH: ${{ (github.event_name != 'pull_request') && (github.repository == 'ros-planning/moveit2') }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Container Registry
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker_lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
name: Lint Dockerfiles
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: hadolint/[email protected]
with:
dockerfile: .docker/${{ matrix.DOCKERFILE_PATH }}/Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Format
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prerelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
name: "${{ matrix.distro }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: industrial_ci
uses: ros-industrial/industrial_ci@master
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
# free up a lot of stuff from /usr/local
sudo rm -rf /usr/local
df -h
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: testspace-com/setup-testspace@v1
if: github.repository == 'ros-planning/moveit2'
with:
Expand Down
2 changes: 2 additions & 0 deletions moveit_core/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<depend>generate_parameter_library</depend>
<depend>geometric_shapes</depend>
<depend>geometry_msgs</depend>
<depend>google_benchmark_vendor</depend>
<depend>kdl_parser</depend>
<depend>libfcl-dev</depend>
<depend>moveit_common</depend>
Expand Down Expand Up @@ -67,6 +68,7 @@
<test_depend>moveit_resources_pr2_description</test_depend>
<test_depend>angles</test_depend>
<test_depend>orocos_kdl_vendor</test_depend>
<test_depend>ament_cmake_google_benchmark</test_depend>
<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_gmock</test_depend>
<test_depend>ament_index_cpp</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ struct MotionPlanResponse
moveit_msgs::msg::RobotState start_state;
std::string planner_id;

/// Sometimes planning request adapters may add states on the solution path (e.g., add the current state of the robot
/// as prefix, when the robot started to plan only from near that state, as the current state itself appears to touch
/// obstacles). This is helpful because the added states should not be considered invalid in all situations.
std::vector<std::size_t> added_path_index; // This won't be included into the MotionPlanResponse ROS 2 message!

// \brief Enable checking of query success or failure, for example if(response) ...
explicit operator bool() const
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class PlanningRequestAdapter
std::function<bool(const planning_scene::PlanningSceneConstPtr&, const planning_interface::MotionPlanRequest&,
planning_interface::MotionPlanResponse&)>;

virtual ~PlanningRequestAdapter() = default;

/** \brief Initialize parameters using the passed Node and parameter namespace.
* @param node Node instance used by the adapter
* @param parameter_namespace Parameter namespace for adapter
Expand All @@ -71,23 +69,7 @@ class PlanningRequestAdapter
/** \brief Get a description of this adapter
* @return Returns a short string that identifies the planning request adapter
*/
virtual std::string getDescription() const
{
return "";
}

/** \brief Adapt the planning request if needed, call the planner
function \e planner and update the planning response if
needed.
* @param planner Pointer to the planner used to solve the passed problem
* @param planning_scene Representation of the environment for the planning
* @param req Motion planning request with a set of constraints
* @param res Reference to which the generated motion plan response is written to
* @return True if response got generated correctly */
bool adaptAndPlan(const planning_interface::PlannerManagerPtr& planner,
const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res) const;
[[nodiscard]] virtual std::string getDescription() const = 0;

/** \brief Adapt the planning request if needed, call the planner
function \e planner and update the planning response if
Expand All @@ -98,15 +80,11 @@ class PlanningRequestAdapter
* @param planning_scene Representation of the environment for the planning
* @param req Motion planning request with a set of constraints
* @param res Reference to which the generated motion plan response is written to
* @param added_path_index Sometimes planning request adapters may add states on the solution path (e.g.,
add the current state of the robot as prefix, when the robot started to plan only from near that state, as the
current state itself appears to touch obstacles). This is helpful because the added states should not be considered
invalid in all situations.
* @return True if response got generated correctly */
bool adaptAndPlan(const planning_interface::PlannerManagerPtr& planner,
const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req, planning_interface::MotionPlanResponse& res,
std::vector<std::size_t>& added_path_index) const;
[[nodiscard]] bool adaptAndPlan(const planning_interface::PlannerManagerPtr& planner,
const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res) const;

/** \brief Adapt the planning request if needed, call the planner
function \e planner and update the planning response if
Expand All @@ -117,36 +95,11 @@ class PlanningRequestAdapter
* @param planning_scene Representation of the environment for the planning
* @param req Motion planning request with a set of constraints
* @param res Reference to which the generated motion plan response is written to
* @param added_path_index Sometimes planning request adapters may add states on the solution path (e.g.,
add the current state of the robot as prefix, when the robot started to plan only from near that state, as the
current state itself appears to touch obstacles). This is helpful because the added states should not be
considered invalid in all situations.
* @return True if response got generated correctly */
virtual bool adaptAndPlan(const PlannerFn& planner, const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res,
std::vector<std::size_t>& added_path_index) const = 0;

protected:
/** \brief Helper param for getting a parameter using a namespace **/
template <typename T>
T getParam(const rclcpp::Node::SharedPtr& node, const rclcpp::Logger& logger, const std::string& parameter_namespace,
const std::string& parameter_name, T default_value = {}) const
{
std::string full_name = parameter_namespace.empty() ? parameter_name : parameter_namespace + "." + parameter_name;
T value;
if (!node->get_parameter(full_name, value))
{
RCLCPP_INFO(logger, "Param '%s' was not set. Using default value: %s", full_name.c_str(),
std::to_string(default_value).c_str());
return default_value;
}
else
{
RCLCPP_INFO(logger, "Param '%s' was set to %s", full_name.c_str(), std::to_string(value).c_str());
return value;
}
}
[[nodiscard]] virtual bool adaptAndPlan(const PlannerFn& planner,
const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res) const = 0;
};

/** \brief Apply a sequence of adapters to a motion plan */
Expand All @@ -163,25 +116,10 @@ class PlanningRequestAdapterChain
* @param req Motion planning request with a set of constraints
* @param res Reference to which the generated motion plan response is written to
* @return True if response got generated correctly */
bool adaptAndPlan(const planning_interface::PlannerManagerPtr& planner,
const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res) const;

/** \brief Iterate through the chain and call all adapters and planners in the correct order
* @param planner Pointer to the planner used to solve the passed problem
* @param planning_scene Representation of the environment for the planning
* @param req Motion planning request with a set of constraints
* @param res Reference to which the generated motion plan response is written to
* @param added_path_index Sometimes planning request adapters may add states on the solution path (e.g.,
add the current state of the robot as prefix, when the robot started to plan only from near that state, as the
current state itself appears to touch obstacles). This is helpful because the added states should not be
considered invalid in all situations.
* @return True if response got generated correctly */
bool adaptAndPlan(const planning_interface::PlannerManagerPtr& planner,
const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req, planning_interface::MotionPlanResponse& res,
std::vector<std::size_t>& added_path_index) const;
[[nodiscard]] bool adaptAndPlan(const planning_interface::PlannerManagerPtr& planner,
const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res) const;

private:
std::vector<PlanningRequestAdapterConstPtr> adapters_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,18 @@ bool callPlannerInterfaceSolve(const planning_interface::PlannerManager& planner

bool callAdapter(const PlanningRequestAdapter& adapter, const PlanningRequestAdapter::PlannerFn& planner,
const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req, planning_interface::MotionPlanResponse& res,
std::vector<std::size_t>& added_path_index)
const planning_interface::MotionPlanRequest& req, planning_interface::MotionPlanResponse& res)
{
try
{
bool result = adapter.adaptAndPlan(planner, planning_scene, req, res, added_path_index);
bool result = adapter.adaptAndPlan(planner, planning_scene, req, res);
RCLCPP_DEBUG_STREAM(LOGGER, adapter.getDescription() << ": " << moveit::core::error_code_to_string(res.error_code));
return result;
}
catch (std::exception& ex)
{
RCLCPP_ERROR(LOGGER, "Exception caught executing adapter '%s': %s\nSkipping adapter instead.",
adapter.getDescription().c_str(), ex.what());
added_path_index.clear();
return planner(planning_scene, req, res);
}
}
Expand All @@ -87,24 +85,14 @@ bool callAdapter(const PlanningRequestAdapter& adapter, const PlanningRequestAda
bool PlanningRequestAdapter::adaptAndPlan(const planning_interface::PlannerManagerPtr& planner,
const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res,
std::vector<std::size_t>& added_path_index) const
planning_interface::MotionPlanResponse& res) const
{
return adaptAndPlan(
[&planner](const planning_scene::PlanningSceneConstPtr& scene, const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res) {
return callPlannerInterfaceSolve(*planner, scene, req, res);
},
planning_scene, req, res, added_path_index);
}

bool PlanningRequestAdapter::adaptAndPlan(const planning_interface::PlannerManagerPtr& planner,
const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res) const
{
std::vector<std::size_t> empty_added_path_index;
return adaptAndPlan(planner, planning_scene, req, res, empty_added_path_index);
planning_scene, req, res);
}

void PlanningRequestAdapterChain::addAdapter(const PlanningRequestAdapterConstPtr& adapter)
Expand All @@ -116,25 +104,12 @@ bool PlanningRequestAdapterChain::adaptAndPlan(const planning_interface::Planner
const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res) const
{
std::vector<std::size_t> empty_added_path_index;
return adaptAndPlan(planner, planning_scene, req, res, empty_added_path_index);
}

bool PlanningRequestAdapterChain::adaptAndPlan(const planning_interface::PlannerManagerPtr& planner,
const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res,
std::vector<std::size_t>& added_path_index) const
{
// if there are no adapters, run the planner directly
if (adapters_.empty())
{
added_path_index.clear();
return callPlannerInterfaceSolve(*planner, planning_scene, req, res);
}
// the index values added by each adapter
std::vector<std::vector<std::size_t>> added_path_index_each(adapters_.size());

// if there are adapters, construct a function for each, in order,
// so that in the end we have a nested sequence of functions that calls all adapters
Expand All @@ -147,30 +122,14 @@ bool PlanningRequestAdapterChain::adaptAndPlan(const planning_interface::Planner

for (int i = adapters_.size() - 1; i >= 0; --i)
{
fn = [&adapter = *adapters_[i], fn, &added_path_index = added_path_index_each[i]](
const planning_scene::PlanningSceneConstPtr& scene, const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res) {
return callAdapter(adapter, fn, scene, req, res, added_path_index);
};
fn = [&adapter = *adapters_[i],
fn](const planning_scene::PlanningSceneConstPtr& scene, const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res) { return callAdapter(adapter, fn, scene, req, res); };
}

bool result = fn(planning_scene, req, res);
added_path_index.clear();

// merge the index values from each adapter
for (std::vector<std::size_t>& added_states_by_each_adapter : added_path_index_each)
{
for (std::size_t& added_index : added_states_by_each_adapter)
{
for (std::size_t& index_in_path : added_path_index)
{
if (added_index <= index_in_path)
index_in_path++;
}
added_path_index.push_back(added_index);
}
}
std::sort(added_path_index.begin(), added_path_index.end());
std::sort(res.added_path_index.begin(), res.added_path_index.end());
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class MOVEIT_PLANNING_SCENE_EXPORT PlanningScene : public std::enable_shared_fro
return world_const_;
}

// brief Get the representation of the world
/** \brief Get the representation of the world */
const collision_detection::WorldPtr& getWorldNonConst()
{
// we always have a world representation
Expand Down
2 changes: 1 addition & 1 deletion moveit_core/robot_model/src/robot_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ void RobotModel::buildMimic(const urdf::ModelInterface& urdf_model)
}
else
{
RCLCPP_ERROR(LOGGER, "Join '%s' cannot mimic joint '%s' because they have different number of DOF",
RCLCPP_ERROR(LOGGER, "Joint '%s' cannot mimic joint '%s' because they have different number of DOF",
joint_model->getName().c_str(), jm->mimic->joint_name.c_str());
}
}
Expand Down
11 changes: 11 additions & 0 deletions moveit_core/robot_state/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ install(DIRECTORY include/ DESTINATION include/moveit_core)

# Unit tests
if(BUILD_TESTING)
find_package(ament_cmake_google_benchmark REQUIRED)
find_package(ament_cmake_gtest REQUIRED)
find_package(benchmark REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(resource_retriever REQUIRED)

Expand Down Expand Up @@ -77,4 +79,13 @@ if(BUILD_TESTING)
moveit_robot_state
moveit_kinematics_base
)

ament_add_google_benchmark(
robot_state_jacobian_benchmark
test/robot_state_jacobian_benchmark.cpp)
target_link_libraries(robot_state_jacobian_benchmark
moveit_robot_model
moveit_test_utils
moveit_robot_state
)
endif()
Loading
Loading