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

Renan/webots ros2 cpp #212

Closed
wants to merge 6 commits into from

Conversation

renan028
Copy link
Member

Description
Webots-ROS2 Cpp interface
It requires a lot of sensors and controllers integration yet, but it is a starting point.
It needs an example (launch file with the wb_task_node).
And a minimal diff_driver_controller (ros2_control integration?).
Please feel free to improve.

In the core, It adds a launch file to just launch webots simulator without controllers (because that would be a job for the cpp node).

Affected Packages
List of affected packages:

  • webots_ros2_core

@ghost
Copy link

ghost commented Mar 16, 2021

DeepCode failed to analyze this pull request

Something went wrong despite trying multiple times, sorry about that.
Please comment this pull request with "Retry DeepCode" to manually retry, or contact us so that a human can look into the issue.

@lukicdarkoo
Copy link
Member

lukicdarkoo commented Mar 16, 2021

Very nice! Thank you for this initiative!

And a minimal diff_driver_controller (ros2_control integration?).

Yes, we want to do everything through ros2_control. Even sensors such as IMU should be integrated through ros2_control.

What is your motivation behind this? We have been considering moving everything to C++ because of ros2_control (see #210). However, Python is a very friendly way to extend a driver. Ideally, we would keep both interfaces (C++ and Python).

This is a very big change (most probably needed one). Therefore, we have to understand challenges quite well and tailor the design carefully.

We should keep the following in mind:

  • Integrate ros2_control #210: As stated in the issue, we want to get rid of the custom-made controllers in favor of the controllers from ros2_control.
  • Question: why not introduce a <webots> tag? urdf2webots#112: All configurations that are currently done through ROS parameters (e.g.
    'topic_name': str, # ROS topic name (default will generated from the sensor name)
    'timestep': int, # Publish period in ms (default is equal to robot's timestep)
    'disable': bool, # Whether to create ROS interface for this sensor (default false)
    'always_publish': bool, # Publish even if there are no subscribers (default false)
    'frame_id': str, # Value for `header.frame_id` field (default is the same as device name)
    ) should live in the <webots> tag. We want to improve URDF export/import, so there is no need for PROTO files if a user prefers URDF.
  • The C++ interface should be easily expandable with C++ and Python.

@renan028
Copy link
Member Author

renan028 commented Mar 17, 2021

I was the main contributor of the Miron-Project, which uses Webots simulator and ROS1 to test some academic research (mainly contextual navigation).
My last contribution to the project was the tiago_webot_ros, a package that integrates the Tiago robot (Pal Robotics) in Webots with the ROS1 Navigation Package.

The project ended in 2020. In my spare time, I started to learn ROS2 and to integrate Navigation2 (ROS2) on the same Tiago project. My goal was to accomplish the same results with ROS2. I manage to integrate everything with the webots_ros2 python package, but I am getting huge offsets in localization and problems to set goals sometimes (I think ROS2/Navigation2 is not stable yet or maybe the problem is mixing python with C++ ? I have to debug).

Currently, I am working with Gazebo (at my current job), but I like to explore other simulators in my spare time. I had a nice experience with Webots before, I like the webots_ros API and I think webots_ros2 is a nice start to play with ROS2. And, I will probably try multi-robot soon on webots ROS1, because I am not happy with Gazebo for this particular purpose.

I will take a look at the ros2_control and the other links you shared, in my spare time, and share with you my thoughts on this integration. But, as you said, this is a big change and it requires a well thought (software architect) design. This draft is currently only a ROS2-cpp version of some sensors (not IMU, which should be in ros2_control).

@lukicdarkoo
Copy link
Member

My last contribution to the project was the tiago_webot_ros, a package that integrates the Tiago robot (Pal Robotics) in Webots with the ROS1 Navigation Package.

Nice project!

but I am getting huge offsets in localization and problems to set goals sometimes

Maybe the odometry is not correct, like wheel separation or wheel radius, or there is some bug in sampling? Anyhow, ros2_control should resolve it.

I will take a look at the ros2_control and the other links you shared, in my spare time, and share with you my thoughts on this integration. But, as you said, this is a big change and it requires a well thought (software architect) design.

We can have a video call to discuss the new design :) I will try to specify some design ideas before.

@renan028
Copy link
Member Author

renan028 commented Mar 18, 2021

We can have a video call to discuss the new design :) I will try to specify some design ideas before.

That would be great. Feel free to add me to a channel where we can discuss it.

@lukicdarkoo
Copy link
Member

Implemented in #221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants