Skip to content

ROS2#74

Merged
josephduchesne merged 4 commits intoavidbots:ros2-plugins-port-brokenfrom
neumann-nico:ros2
Aug 17, 2020
Merged

ROS2#74
josephduchesne merged 4 commits intoavidbots:ros2-plugins-port-brokenfrom
neumann-nico:ros2

Conversation

@neumann-nico
Copy link

@neumann-nico neumann-nico commented Aug 16, 2020

This pull request provides some fixes and updates for flatland_server and flatland_plugins.

  • Fixed segmentation fault in tricycle and diff drive plugin (plugins seem to work but there might be still problems)
  • Added missing dependencies
  • Updated deprecated commands in CMakeLists.txt and code for ros2 foxy

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.

Copy link
Collaborator

@josephduchesne josephduchesne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this no longer needed? or never needed?).
If so, maybe we can just remove the whole thing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented the line for test purpose and forgot the uncomment it, sorry!

@josephduchesne josephduchesne merged commit f0cdfdd into avidbots:ros2-plugins-port-broken Aug 17, 2020
Copy link
Author

@neumann-nico neumann-nico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added come code comments

@@ -349,7 +349,7 @@ void SpawnModelTool::LoadPolygonFootprint(
}
if (points.size() > 0) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
Copy link
Author

@neumann-nico neumann-nico Aug 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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 markers

Update:
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);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it is a good way to create the node locally here or better as member variable?

JoaoCostaIFG pushed a commit to JoaoCostaIFG/flatland that referenced this pull request Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants