-
Notifications
You must be signed in to change notification settings - Fork 493
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
[Ready] Port move_group to ROS2, fix some extra parameters #217
Conversation
Codecov Report
@@ Coverage Diff @@
## master #217 +/- ##
==========================================
- Coverage 47.67% 46.45% -1.23%
==========================================
Files 155 123 -32
Lines 15691 12781 -2910
==========================================
- Hits 7481 5937 -1544
+ Misses 8210 6844 -1366
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This really looks almost done, just some minor comments to address.
With declared parameters the demo works out of the box for me (both on Foxy and Eloquent, rebased onto the latest branches). Also, thanks for fixing up the parameter callbacks, do you have a working example for this? The old cfg files can be removed.
moveit_ros/planning/trajectory_execution_manager/src/trajectory_execution_manager.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/src/current_state_monitor.cpp
Outdated
Show resolved
Hide resolved
RCLCPP_INFO(LOGGER, "MoveGroup debug mode is OFF"); | ||
|
||
rclcpp::executors::MultiThreadedExecutor executor; | ||
rclcpp::Node::SharedPtr monitor_node = rclcpp::Node::make_shared("monitor_node", opt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the name be "move_group_node" or something like that? I think the PlanningSceneMonitor will use it's internal thread for monitoring anyway (#230)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this monitor_node is fed into planning_scene_monitor->startStateMonitor
to prevent subscribers from never receiving messages. we can wait for #230 to go in first and adjust accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would probably make sense to merge that one first and then adjust it here. Do you see any issues with the implementation in #230? Woudl be great to have a review that is based on an actual use case like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#230 is merged
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp
Outdated
Show resolved
Hide resolved
I referenced from these sources: https://github.com/ros2/rclcpp/blob/master/rclcpp_lifecycle/test/test_lifecycle_node.cpp#L421 edit: removed cfg file b1c82a0 |
@ddengster as this is about to be ready, could you squash the commit history into several chunks before merging? clang-format, clang-tidy fixes, cleanup, rebase etc clutter up the commit history but we really want to keep the meaningful steps in your development. |
desc.set__name("publish_planning_scene"); | ||
desc.set__description("Set to True to publish Planning Scenes"); | ||
bool publish_planning_scene = node_->declare_parameter("planning_scene_monitor.publish_planning_scene", false, desc); | ||
|
||
desc.set__name("publish_geometry_updates"); | ||
desc.set__description("Set to True to publish geometry updates of the planning scene"); | ||
bool publish_geom_updates = node_->declare_parameter("planning_scene_monitor.publish_geometry_updates", true, desc); | ||
|
||
desc.set__name("publish_state_updates"); | ||
desc.set__description("Set to True to publish state updates of the planning scene"); | ||
bool publish_state_updates = node_->declare_parameter("planning_scene_monitor.publish_state_updates", false, desc); | ||
|
||
desc.set__name("publish_transforms_updates"); | ||
desc.set__description("Set to True to publish transform updates of the planning scene"); | ||
bool publish_transform_updates = node_->declare_parameter("planning_scene_monitor.publish_transforms_updates", false, desc); | ||
|
||
desc.set__type(rclcpp::ParameterType::PARAMETER_DOUBLE); | ||
desc.set__name("publish_planning_scene_hz"); | ||
desc.set__description("Set the maximum frequency at which planning scene updates are published"); | ||
double publish_planning_scene_hz = node_->declare_parameter("planning_scene_monitor.publish_planning_scene_hz", 4.0, desc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to check if the parameter is declared for the node before declaring it otherwise it will throw an exception, for example, if we create two monitors for the same node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has_parameter check before declare/get parameter 7f381b0
@henningkayser i've cut it down to 28 commits, let me know if you want it squashed further |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, there still seem to be some regressions I tagged with the comments. Commit history is a bit long but it seems very descriptive so I'm fine with it.
if (action_res->error_code.val == moveit_msgs::msg::MoveItErrorCodes::PREEMPTED) | ||
{ | ||
//@todo: wait for preempt? | ||
// move_action_server_->setPreempted(action_res, response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the goal just get canceled here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc in ros1 there was setCanceled and setPreempted, i wasn't sure what the difference was. anyway, i changed this to canceled 44c1643
@@ -38,6 +38,8 @@ | |||
#include <tf2_ros/transform_listener.h> | |||
#include <moveit/move_group/capability_names.h> | |||
#include <moveit/move_group/move_group_capability.h> | |||
#include <moveit/move_group/move_group_context.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two includes seem redundant. I guess they were removed with the sync but then just added again with the rebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed redundant 44c1643
@@ -497,7 +528,7 @@ bool PlanningSceneMonitor::requestPlanningSceneState(const std::string& service_ | |||
throw std::runtime_error("requestPlanningSceneState() to self-provided service: " + service_name); | |||
} | |||
// use global namespace for service | |||
auto client = pnode_->create_client<moveit_msgs::srv::GetPlanningScene>(service_name); | |||
auto client = node_->create_client<moveit_msgs::srv::GetPlanningScene>(service_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert, these and below should be pnode_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted 44c1643
// reconfigure_impl_ = new DynamicReconfigureImpl(this); | ||
|
||
// Set up publishing parameters | ||
rcl_interfaces::msg::ParameterDescriptor desc; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the lines below is causing a seg-fault, I wasn't able to determine which one but commenting them seems to fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you rebase onto #257? It could be the same timing issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed parameter 44c1643
edit: i ran the demo, it seems to be working fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ddengster Looks good to me. Please consider merging https://github.com/ddengster/moveit2/pull/2 first, but then please rebase and lgtm
fix current state monitor not listening for joint_state messages while waiting fix clock type exception
fix move_group query_planners service name
backport fixes, some cleanup clang format fixes more cleanup + clang format #2
clang format fixes #2 cmake style fixes, clang warning fixes revert clang warning fixes rebase fixes
remove unused variable warnings clang warning fixes fixed/aligned cmake fix cmake c++ standard namespace fix revert state time
remove redundant includes
Description
Siphoned from PR #187
Accompanies PR #204 if you want things to work beyond compiling.merged!Other changes include:
ompl_interface
switched to plugin manager'/'
have been replaced by'.'
inplanning/planning_request_adapter_plugins/src/fix_start_state_bounds.cpp
,planning/planning_scene_monitor/src/planning_scene_monitor.cpp
,planning/robot_model_loader/src/robot_model_loader.cpp
planning_scene_monitor
andtrajectory_execution_manager
has been integrated into a callback. You can look at the old definitions in the respective .cfg filesmove_group's test has not been ported due to dependencies, see here.
Edit: It's compiling, but should we delay the codecov to another PR?
Checklist