0
$\begingroup$

Rosanswers logo

hi i am trying to make a control loop for a urdf file that i built, can i use a pr2 controller or it won't work?

thanks nachum

i was able to insert the code given below and spawn my model- i tried to run the controller single_joint_position_action by , rosrun bin/single_joint_position_action [floor] that gave me the error [rospack] Error: stack/package bin/single_joint_position_action not found. also by bin/single_joint_position_action [floor] and got error [FATAL] [1346922550.250377578]: No joint given.

how should i use it?

thanks Nachum


Originally posted by Nachum on ROS Answers with karma: 208 on 2012-09-04

Post score: 2


Original comments

Comment by Lorenz on 2012-09-04:
It would really help if you indent your xml code correctly. At the moment it is extremely hard to read. Your edit is not really related to the original question. Please open a new question.

Comment by Lorenz on 2012-09-05:
Did you configure a controller using ros parameters and spawn it using the controller manager as described in the tutorials I linked?

Comment by Nachum on 2012-09-05:
not sure i am doing it right.. i made a launch file as described there and tried to launch it but got error rosrun] Couldn't find executable named a.launch below /home/nachum/joint_states_listener [rosrun] Found the following, but they're either not files, [rosrun] or not executable:

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

A lot of pr2 controllers are actually pretty generic, given you provide the same infrastructure as the PR2. The package robot_mechanism_controllers provides a bunch joint controllers and KDL based cartesian controllers.

If you are just working in Gazebo, using pr2 controllers is pretty strait forward. Just add the following to your urdf:

  <gazebo>
    <controller:gazebo_ros_controller_manager name="gazebo_ros_controller_manager" plugin="libgazebo_ros_controller_manager.so">
      <alwaysOn>true</alwaysOn>
      <updateRate>1000.0</updateRate>
      <interface:audio name="gazebo_ros_controller_manager_dummy_iface" />
    </controller:gazebo_ros_controller_manager>
  </gazebo>

On a real robot, you need provide a node that links against the pr2_controller_manager and implements the required hardware backend.

Edit: Have a look at the pr2_controllers tutorials to find out how to use them. In particular this tutorial is probably the most interesting one for you.


Originally posted by Lorenz with karma: 22731 on 2012-09-04

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Nachum on 2012-09-04:
thanks for your answers. i am sorry i am very new in ros+gazebo, how do i get these controllers?

Comment by Nachum on 2012-09-04:
I tried runnig my model after i put in that code and it wasn't able to spawn it. any ideas? rosrun gazebo spawn_model -file ROS_ROBIL_ROOT/pendelum.urdf -urdf -model bob loading model xml from file [INFO] [WallTime: 1346837977.412185] [0.000000] waiting for service /gazebo/spawn_urdf_model

Comment by Lorenz on 2012-09-04:
Which error did you get when trying to spawn the model? The info message you posted just indicates that spawn is waiting for gazebo to come up.

Comment by Nachum on 2012-09-04:
didn't get, it just isn't doing any thing. w/o that piece of code after a seccond it spawned

Comment by Nachum on 2012-09-05:
in the terminal of gazebo it said this- Warning [parser.cc:348] Gazebo SDF has no gazebo element Warning [parser.cc:291] DEPRECATED GAZEBO MODEL FILE On July 1st, 2012, this formate will no longer by supported Convert your files using the gzsdf command line tool You have been warned!

Dbg plugin mod

Comment by Nachum on 2012-09-05:
plugin model name: bob [ INFO] [1346837939.708637306, 917.508000000]: starting gazebo_ros_controller_manager plugin in ns: / [ INFO] [1346837939.708766143, 917.508000000]: Callback thread id=0x7f1ff410f2a0

Comment by Lorenz on 2012-09-05:
I remember that the controller manager actually needs transmissions defined in your URDF. Try adding them similar to the PR2 urdf.

Comment by Bharadwaj on 2013-02-12:
@lorenz : I am trying the same thing. I face a different error. I have a question posted in the following like, can you please check and see if kno what the error is telling me http://answers.ros.org/question/55082/error-adding-controller-script-in-simple-urdf-model-to-be-simulated-on-gazebo/

$\endgroup$

Your Answer

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