ROS2#74
Conversation
josephduchesne
left a comment
There was a problem hiding this comment.
Thanks for the solid contribution. This is a big step towards everything working in ros2. I started the port before Foxy came out, but I think that makes more sense to target for a first fully functioning release. The master branch has upgrades to the ros-industrial CI branch integration that I believe now supports ros2. That and finishing the flatland_viz port are the two main outstanding parts.
| @@ -349,7 +349,7 @@ void SpawnModelTool::LoadPolygonFootprint( | |||
| } | |||
| if (points.size() > 0) { | |||
There was a problem hiding this comment.
Was this no longer needed? or never needed?).
If so, maybe we can just remove the whole thing.
There was a problem hiding this comment.
I commented the line for test purpose and forgot the uncomment it, sorry!
neumann-nico
left a comment
There was a problem hiding this comment.
added come code comments
| @@ -349,7 +349,7 @@ void SpawnModelTool::LoadPolygonFootprint( | |||
| } | |||
| if (points.size() > 0) { | |||
There was a problem hiding this comment.
I commented the line for test purpose and forgot the uncomment it, sorry!
| plugin_manager_.AfterPhysicsStep(timekeeper); | ||
| } | ||
| //int_marker_manager_.update(); | ||
| int_marker_manager_.update(); |
There was a problem hiding this comment.
@josephduchesne
Update of interactive marker is working in rviz2, but the cart is flickering and rviz2 says that it expects a different sequence number of the marker than received. It seems like only every fifth sequence is sent/received.
[rviz]: Service response received for initialization
[rviz]: Update sequence number is out of order. 694 (expected) vs. 699 (received)
[rviz]: Sending request for interactive markers
[rviz]: Service response received for initialization
[rviz]: Update sequence number is out of order. 707 (expected) vs. 714 (received)
[rviz]: Sending request for interactive markersUpdate:
I just checked InteractiveMarkerServer::applyChanges():
The sequence number is updated when calling applyChanges. Not sure if there is a problem in flatland code or InteractiveMarkerServer.
With an update_rate of 30.0 instead of 200.0 the sequence numbers are not out of order anymore.
A higher rate leads to sequence number out of order. But 30.0 is very slow and 200.0 works fine in ros1.
| get_parameter_or("update_rate", update_rate_, 200.0f); | ||
| get_parameter_or("step_size", step_size_, 1.0f/200.0f); | ||
| get_parameter_or("show_viz", show_viz_, 0.0f); | ||
| get_parameter_or("show_viz", show_viz_, false); |
There was a problem hiding this comment.
This was changed from bool (master/ros1) to double (@josephduchesne ros2 commits).
Is there a reason to save it as double? I changed it back to bool.
| void PauseSimTool::onInitialize() { | ||
| pause_service_ = nh_.serviceClient<std_srvs::Empty>("toggle_pause"); | ||
| setName("Pause/Resume"); | ||
| std::shared_ptr<rclcpp::Node> node = rclcpp::Node::make_shared("pause_sim_tool"); // TODO |
There was a problem hiding this comment.
Not sure if it is a good way to create the node locally here or better as member variable?
| srv->pose.theta = initial_angle; | ||
|
|
||
| client = nh.serviceClient<flatland_msgs::msg::SpawnModel>("spawn_model"); | ||
| std::shared_ptr<rclcpp::Node> node = rclcpp::Node::make_shared("spawn_model_tool"); // TODO |
There was a problem hiding this comment.
Not sure if it is a good way to create the node locally here or better as member variable?
| moving_model_node_->removeAllChildren(); | ||
| lines_list_.clear(); | ||
|
|
||
| std::shared_ptr<rclcpp::Node> node = rclcpp::Node::make_shared("spawn_model_tool"); // TODO |
There was a problem hiding this comment.
Not sure if it is a good way to create the node locally here or better as member variable?
Merging in @neumann-nico 's ros2 fixes.
This pull request provides some fixes and updates for flatland_server and flatland_plugins.
I tried to port flatland_viz but there is still a lot to do. The biggest problem is that many included header files are not publicly available in rviz2. I'm not sure how to deal with this problem yet.
Tested on Ubuntu 20.04 with ROS2 foxy.