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

Example package for ignition systems plugin #28

Open
ruffsl opened this issue Sep 19, 2020 · 3 comments
Open

Example package for ignition systems plugin #28

ruffsl opened this issue Sep 19, 2020 · 3 comments
Labels
ignition Ignition

Comments

@ruffsl
Copy link

ruffsl commented Sep 19, 2020

It would be nice to have an example of how to package a custom systems plugin for ignition. For example, the classic gazebo version of dolly uses the libgazebo_ros_diff_drive plugin for mapping command velocities to the joint control for a respective wheelbase of the robot:

<plugin name='diff_drive' filename='libgazebo_ros_diff_drive.so'>

The ignition gazebo version of dolly uses the libignition-gazebo-diff-drive-system instead:

<plugin
filename="libignition-gazebo-diff-drive-system.so"
name="ignition::gazebo::systems::DiffDrive">

For instances where an existing plugin bundled in ignition may not suffice or not exist, it would be helpful to have a packaged example of something like the diff_drive plugin as a local package here.

https://github.com/ignitionrobotics/ign-gazebo/tree/5b21ec87306c35b3494adc25694fac8b8d1bb7de/src/systems/diff_drive

Perhaps a simple ignition plugin to control the tail_joint of dolly, that could be controlled via topic to active waggle, passively dampen, or hold still/break. It would also provide as a reference template for the cmake and ament exports necessary for ignition to find and load the externally compiled plugin.

<joint name='tail_joint' type='revolute'>

Personally, I'd like to prototype an ackermann steering model, but want to avoid having to rebuild the entire ign-gazebo code base until the plugin is working and ready to upstream, keeping my development confined to a minimal dolly like colcon workspace/repo. As of yet, the current Ignition Robotics plugin and systems docs do not specify how to write your own, external from the upstream binaries.

@chapulina
Copy link
Owner

an example of how to package a custom systems plugin for ignition

There are a few examples here:

https://github.com/ignitionrobotics/ign-gazebo/tree/master/examples/plugin

This tutorial should also be helpful:

https://ignitionrobotics.org/api/gazebo/3.3/createsystemplugins.html

The recommendation is to write pure CMake packages for all functionality that isn't ROS-specific and use the ros-ign bridge to connect to ROS. This is meant to make the code more reusable. For example, on Gazebo-classic, we have a pure-cmake gazebo::DiffDrivePlugin, and also the ROS-enabled gazebo_plugins::GazeboRosDiffDrive - which has always been a pain to maintain.

I'd like to prototype an ackermann steering model, but want to avoid having to rebuild the entire ign-gazebo code base until the plugin is working

With the separation of concerns above in mind, I'd recommend you write a ROS package that contains:

  • An Ackermann drive ign-gazebo system that's a pure CMake project and links against ign-gazebo, but not against ROS
  • A launch file that spawns a model with the plugin above, and also starts the ros_ign_bridge for the cmd_vel twist message

Perhaps a simple ignition plugin to control the tail_joint of dolly, that could be controlled via topic to active waggle, passively dampen, or hold still/break. It would also provide as a reference template for the cmake and ament exports necessary for ignition to find and load the externally compiled plugin.

I agree that this would be a valuable example, I'll look into adding one

As of yet, the current Ignition Robotics plugin and systems docs do not specify how to write your own, external from the upstream binaries.

I think we could do a better job linking to the resources I pointed out above: the example plugins and the tutorials.

@chapulina chapulina added the ignition Ignition label Sep 19, 2020
@cocodmdr
Copy link

Hello,

Are there news on this issue ?

I would like to build a modified version of diff_drive plugin in order to control a third directionnal wheel. Instead of the caster wheel there is a motorised fork with a motorised wheel.

I am trying to understand how to add a plugin but I am facing issues when I import custom plugins.

Regards.

@chapulina
Copy link
Owner

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

No branches or pull requests

3 participants