Gazebo | Ignition | Community
Ask Your Question
0

How to confige an official plugin in model file?

asked 2020-11-04 07:13:09 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi everyone! Now I was confuse about how to setting the parameters of some official plugin in model file(such as urdf,xacro,sdf...)

As the official tutorial has said,

Modify the end of the Load function to read the <velocity> using the sdf::ElementPtr parameter.

// Default to zero velocity
double velocity = 0;

// Check that the velocity element exists, then read the value
if (_sdf->HasElement("velocity"))
  velocity = _sdf->Get<double>("velocity");

// Set the joint's target velocity. This target velocity is just
// for demonstration purposes.
this->model->GetJointController()->SetVelocityTarget(
    this->joint->GetScopedName(), velocity);

Actually, I can only see the members of the class on the official documentation.

So, I was wondering how to get the parameter which is needed to confige the plugin? Like

<gazebo reference="your_link_name">
  <plugin name="your_link_laser_controller" filename="libgazebo_ros_laser.so">
    ... plugin parameters ...
  </plugin>

Thanks a lot!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-12-18 13:17:08 -0500

ahcorde gravatar image

Hi,

you can have a look to the gazebo_ros_laser.world. In particular these lines. You will be able to configure the plugin.

Regards

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-11-04 07:13:09 -0500

Seen: 19 times

Last updated: Dec 18 '20