Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How Do I Use Both Sensor and Model Plugins to Control a Model?

In my quest to garner Gazebo simulation skills I have made a model plugin for proportional joint control of a simple robot model. The plugin applies a joint torque that is proportional to the difference between the joint's current and desired positions. I suppose if the model had more joints I could just add JointPtrs to the plugin and control them all. My question is, how can I add sensor data to this joint controller? For example, maybe my desired joint position is determined by a camera or a sonar sensor.

My current thought is that I have to find some way for the sensor plugin (it would be nice to be able to use libSonarPlugin.so) to provide my model plugin with data. I'm just guessing that this would entail creating a "node" (?) in my model plugin that "subscribes" (?) to the msgs::SonarStamped msg_ in SonarPlugin.hh. If so then should I follow this tutorial: http://gazebosim.org/tutorials?tut=topics_subscribed? I'll greatly appreciate it if you can help me get my bearings on this issue.

How Do I Use Both Sensor and Model Plugins to Control a Model?

In my quest to garner Gazebo simulation skills I have made a model plugin for proportional joint control of a simple robot model. The plugin applies a joint torque that is proportional to the difference between the joint's current and desired positions. I suppose if the model had more joints I could just add JointPtrs to the plugin and control them all. My question is, how can I add incorporate sensor data to in this joint controller? For example, maybe my desired joint position is determined by values from a camera or a sonar sensor.

My current thought is that I have to find some way for the sensor plugin (it would be nice to be able to use libSonarPlugin.so) to provide my model plugin with data. I'm just guessing that this would entail creating a "node" (?) in my model plugin that "subscribes" (?) to the msgs::SonarStamped msg_ in SonarPlugin.hh. If so then should I follow this tutorial: http://gazebosim.org/tutorials?tut=topics_subscribed? I'll greatly appreciate it if you can help me get my bearings on this issue.

How Do I Use Both Sensor and Model Plugins to Control a Model?

In my quest to garner Gazebo simulation skills I have made a model plugin for proportional joint control of a simple robot model. The plugin applies a joint torque that is proportional to the difference between the joint's current and desired positions. I suppose if the model had more joints I could just add JointPtrs to the plugin and control them all. My question is, how can I incorporate sensor data in this joint controller? For example, maybe my desired joint position is determined by values from a camera or a sonar sensor.

My current thought is that I have to find some way for the sensor plugin (it would be nice to be able to use libSonarPlugin.so) to provide my model plugin with data. I'm just guessing that this would entail creating a "node" (?) in my model plugin that "subscribes" (?) to the msgs::SonarStamped msg_ in SonarPlugin.hh. If so then should I follow this tutorial: http://gazebosim.org/tutorials?tut=topics_subscribed? this tutorial? I'll greatly appreciate it if you can help me get my bearings on this issue.