1
$\begingroup$

I was wondering how can add a new node type to activate under the <device> tag in the URDF file. Looking in the webots_ros2 repository, I found that is required to create a header and implementation file accordingly with the C++ plugin tutorial.

Can anybody give me some guidance to include this? I'm interested in using the Emitter and Receiver nodes.

Thank in advance

$\endgroup$

1 Answer 1

1
$\begingroup$

The first possibility is to add the new sensors (Emitter and Receiver) to the list of supported devices in the webots_ros2_driver package. This would require modifying or enhancing the source code of the package. This would allow you to use the sensors in your URDF files without the need for a custom plugin. Please feel free to open a PR with your contribution if you decide to use this solution. You could use other already implemented devices (webots_ros2_driver/src/plugins) as examples.

The second possibility is to create a custom plugin that uses the C controller API to access the devices, configure them and get their values. This would require writing a custom plugin that interfaces with the Webots simulation software. You would then need to add the plugin to the URDF file.

You can create your custom plugin in C++ or Python:

If you use the plugin in C++, make sure you use the C controller API as the C++ controller API cannot be used anymore since version 2023.0.0 of the package.

$\endgroup$
1
  • $\begingroup$ Indeed the plugin way is the one that I'm following. I currently have a dev-stage branch in C++, current tests are presenting a struct data issue with the return of the wb_emitter_get_data() function to publish the output as a topic. I in the following weeks I will publish the resultant code. $\endgroup$ Feb 27, 2023 at 1:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.