Skip to content

Conversation

@LucasWaelti
Copy link
Contributor

Description
Added instructions to implement a ROS node to serve as an extern Webots controller in C++. Only Python has been mentioned so far.
This only requires some minimal setup in the ROS package's CMakeLists.txt and is therefore quite straightforward.

Documentation
This pull-request changes the following file:
https://cyberbotics.com/doc/guide/using-ros?version=released

Added instructions to implement a ROS node to serve as an extern Webots controller in C++. Only Python has been mentioned so far.
@LucasWaelti LucasWaelti added the documentation Improve or fix the documentation (MD files only, no software development) label May 25, 2023
@LucasWaelti LucasWaelti requested a review from a team as a code owner May 25, 2023 13:38
@BenjaminDeleze BenjaminDeleze requested a review from ygoumaz May 25, 2023 13:44
Copy link
Contributor

@ygoumaz ygoumaz left a comment

Choose a reason for hiding this comment

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

Thank you for the enhancement!

I am wondering if we should not directly provide a sample C++ controller corresponding to ros_python.py and call it ros_cpp.cpp. The package could also contain the CMakeLists.txt file. The controller could be compiled from the webots_ros package and a dedicated launch file (webots_ros_cpp.launch) would allow to start the same world as the Python example with the compiled C++ controller.

The content of the CMakeLists.txt file could be removed from the .md documentation and we could provide instructions to run the launch file equivalent to the Python one.

LucasWaelti and others added 2 commits May 25, 2023 17:36
Co-authored-by: Yannick Goumaz <[email protected]>
Co-authored-by: Yannick Goumaz <[email protected]>
@LucasWaelti
Copy link
Contributor Author

I am wondering if we should not directly provide a sample C++ controller corresponding to ros_python.py and call it ros_cpp.cpp.

For me, it makes sense to keep the cmake instructions in the doc because they are generally applicable and precisely show what has to be added. Might be more straightforward than having to look up an example...

@ygoumaz
Copy link
Contributor

ygoumaz commented May 26, 2023

I agree with you. While it is important to keep the content in the document for reference and quick lookup, I would still include the example in the package. Simply relying on the CMakeLists file may not be straightforward for everyone to implement. Adding the example in the project, along with the detailed file and instructions in the documentation, would help users to understand the differences with the Python implementation (including the controller file), while also being able to run it.

Note: there is a small error in the test of the documentation related to uppercase in a title.

@omichel omichel requested a review from ygoumaz June 9, 2023 09:01
@ygoumaz ygoumaz added this to the R2023b-rev1 milestone Jun 26, 2023
Copy link
Contributor

@ygoumaz ygoumaz left a comment

Choose a reason for hiding this comment

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

This PR is still waiting for the required changes.

@LucasWaelti
Copy link
Contributor Author

Just to clarify, I do not have time to implement myself an example for this (if this is what was understood), sorry!

@ygoumaz
Copy link
Contributor

ygoumaz commented Jul 11, 2023

As it is, I really believe it won't help a lot of people. Experts in programming will easily find a way to get the equivalent in C++, while beginners will struggle with this only paragraph in the documentation. Without a concrete example I think this doesn't make a lot of sense, lacks some clarity and is not consistent with the current Python example. I am closing this PR for now. Feel free to reopen it if you find time to implement the example.

@ygoumaz ygoumaz closed this Jul 11, 2023
@LucasWaelti
Copy link
Contributor Author

As you wish, if you prefer to provide no help at all instead of a useful hint, which only requires some basic knowledge about how to build a ROS node, fine by me...
If I find the time, I'll try and create an example though as I think this really should be part of the documentation. This has definitely been lacking for me at least.

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

Labels

documentation Improve or fix the documentation (MD files only, no software development)

Development

Successfully merging this pull request may close these issues.

5 participants