-
Notifications
You must be signed in to change notification settings - Fork 558
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
Port planning_scene_monitor to ROS2 #112
Port planning_scene_monitor to ROS2 #112
Conversation
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.
I'm only half way through. I'll give this a second round tomorrow
moveit_ros/planning/planning_scene_monitor/demos/demo_scene.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/demos/demo_scene.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/demos/demo_scene.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/demos/demo_scene.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/src/current_state_monitor.cpp
Outdated
Show resolved
Hide resolved
if (tf_buffer_ && !robot_model_->getMultiDOFJointModels().empty()) | ||
{ | ||
tf_connection_.reset(new TFConnection( | ||
tf_buffer_->_addTransformsChangedListener(boost::bind(&CurrentStateMonitor::tfCallback, this)))); | ||
// TODO (anasarrak): replace this for the appropiate function, there is no similar |
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.
There should be one now
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.
They replaced it see, I should change MoveIt to use the new API and will port it to MoveIt2
moveit_ros/planning/planning_scene_monitor/src/current_state_monitor.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/src/current_state_monitor.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/src/current_state_monitor.cpp
Show resolved
Hide resolved
a85908f
to
c96c9ba
Compare
e8bfb9e
to
a4e5721
Compare
moveit_ros/planning/planning_scene_monitor/demos/demo_scene.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/demos/demo_scene.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/demos/demo_scene.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/demos/demo_scene.cpp
Outdated
Show resolved
Hide resolved
...lanning/planning_scene_monitor/include/moveit/planning_scene_monitor/current_state_monitor.h
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp
Outdated
Show resolved
Hide resolved
(robot_description_[0] == '/') ? robot_description_.substr(1) : robot_description_; | ||
|
||
nh_.param(robot_description + "_planning/default_robot_padding", default_robot_padd_, 0.0); |
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 have direct corresponding functions, we don't need to check has_parameter
everywhere.
moveit_ros/planning/planning_scene_monitor/src/trajectory_monitor.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/src/trajectory_monitor.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/src/trajectory_monitor.cpp
Outdated
Show resolved
Hide resolved
b8fdfd7
to
ad3e12b
Compare
@RoboticsYY thanks for fixing this up so far! Could you squash/cleanup the commit history and address the remaining points? Then lgtm |
70d8bf2
to
1f46a61
Compare
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.
@JafarAbdi I have left some comments to the code I think I haven't finished clean-up or found an answer to.
ros::Subscriber collision_object_subscriber_; | ||
rclcpp::Subscription<moveit_msgs::msg::AttachedCollisionObject>::SharedPtr attached_collision_object_subscriber_; | ||
rclcpp::Subscription<moveit_msgs::msg::CollisionObject>::SharedPtr collision_object_subscriber_; | ||
std::unique_ptr<tf2_ros::MessageFilter<moveit_msgs::msg::CollisionObject> > collision_object_filter_; |
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.
collision_object_filter
seems not necessary.
@@ -544,21 +539,22 @@ class PlanningSceneMonitor : private boost::noncopyable | |||
|
|||
/// the amount of time to wait in between updates to the robot state | |||
// This field is protected by state_pending_mutex_ | |||
ros::WallDuration dt_state_update_; | |||
std::chrono::duration<double> dt_state_update_; // 1hz |
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.
Maybe there should be some global guidance about replacing ros::WallTime
and ros::WallDuration
by std::chrono::system_clock::time_point
and std::chrono::duration
.
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.
I agree we should add an alias for that something like moveit::TimePoint
moveit_ros/planning/planning_scene_monitor/src/current_state_monitor.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/src/current_state_monitor.cpp
Outdated
Show resolved
Hide resolved
// TODO: (anasarrak) callbacks on ROS2? | ||
// https://answers.ros.org/question/300874/how-do-you-use-callbackgroups-as-a-replacement-for-callbackqueues-in-ros2/ | ||
// ros::CallbackQueue queue_; | ||
std::shared_ptr<rclcpp::executors::SingleThreadedExecutor> spinner_; |
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.
spinner_
seems not necessary.
moveit_ros/planning/planning_scene_monitor/src/current_state_monitor.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp
Outdated
Show resolved
Hide resolved
else | ||
{ | ||
ROS_DEBUG_NAMED(LOGNAME, "Reading additional default collision operations"); | ||
|
||
XmlRpc::XmlRpcValue coll_ops; |
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.
Refactor for XmlRpc
.
node_->get_parameter_or(robot_description + "_planning/default_attached_padding", default_attached_padd_, 0.0); | ||
default_robot_link_padd_ = std::map<std::string, double>(); | ||
default_robot_link_scale_ = std::map<std::string, double>(); | ||
// TODO: enable parameter type support to std::map |
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.
Seems ROS2 doesn't support parameter type for std::map
.
acm.setEntry(std::string(coll_ops[i]["object1"]), std::string(coll_ops[i]["object2"]), | ||
std::string(coll_ops[i]["operation"]) == "disable"); | ||
} | ||
RCLCPP_DEBUG(LOGGER, "Reading additional default collision operations"); |
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.
ab2cf37
to
37a5081
Compare
37a5081
to
aaf8189
Compare
aaf8189
to
0a10aa6
Compare
0a10aa6
to
08e006b
Compare
No description provided.