0
$\begingroup$

Gazebo Answers logo

Hi there,

I'm trying to control a Pioneer2dx with DiffDrivePlugin. Whenever I start the server, an error occurs. I got the plugin from here. No errors are coming while complilng.
Error:
Error [Element.cc:671] Missing element description for [left_joint]
gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:648: typename boost::detail::sp_member_access::type boost::shared_ptr::operator->() const [with T = sdf::Element; typename boost::detail::sp_member_access::type = sdf::Element
]: Assertion `px != 0' failed.
Aborted
*

What is this error and why this is coming? Can anyone provide me a solution?

Thanks in advance!


Originally posted by Anand George on Gazebo Answers with karma: 11 on 2015-12-16

Post score: 0


Original comments

Comment by nkoenig on 2015-12-16:
Can you post your world file, the command you are using to run gazebo, and the version of gazebo you are using?

Comment by Anand George on 2015-12-16:
Here is the world file: http://pastebin.com/q4urVZKq ; Gazebo version 6.1.0 ; command: gzserver -u test.world

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

You'll have to tell the diffdrive plugin about the joints in the model that the plugin should control. Here is an example:

<include>
  <uri>model://pioneer2dx</uri>
  <plugin name="DiffDrivePlugin" filename="build/libDiffDrivePlugin.so">
    <left_joint>pioneer2dx::left_wheel_hinge</left_joint>
    <right_joint>pioneer2dx::right_wheel_hinge</right_joint>
  </plugin>
</include>

Originally posted by nkoenig with karma: 7676 on 2015-12-16

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Anand George on 2015-12-16:
Still the same error is coming.

Comment by nkoenig on 2015-12-16:
I took a look at the pioneer2dx model, and it already loads the diff drive plugin: https://bitbucket.org/osrf/gazebo_models/src/e024fe922c810f468e2a7ab277750354465478cd/pioneer2dx/model.sdf?at=default&fileviewer=file-view-default#model.sdf-175

Comment by Anand George on 2015-12-16:
So, I don't have to attach the plugin to the model. Therefore by publishing the required data to the topic ~/vel_cmd, canI control the robot? What data I have to publish?

Comment by nkoenig on 2015-12-16:
You should be able to. You can find out the type of message by using gz topic -i /gazebo/default/vel_cmd

Comment by Anand George on 2015-12-16:
It worked! Is there any method to move the robot to a location in the plane by specifying the coordinates?

Comment by nkoenig on 2015-12-16:
There is no built in method. You'll have to handle that computation yourself.

Comment by Anand George on 2015-12-16:
Okay thanks!!

$\endgroup$

Your Answer

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