ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

can i use a pr2 controller for my own urdf

asked 2012-09-04 01:05:35 -0500

Nachum gravatar image

updated 2012-09-05 23:17:48 -0500

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

edit retag flag offensive close merge delete

Comments

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.

Lorenz gravatar image Lorenz  ( 2012-09-04 23:39:40 -0500 )edit

Did you configure a controller using ros parameters and spawn it using the controller manager as described in the tutorials I linked?

Lorenz gravatar image Lorenz  ( 2012-09-05 23:22:52 -0500 )edit

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:

Nachum gravatar image Nachum  ( 2012-09-05 23:46:43 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2012-09-04 04:33:14 -0500

Lorenz gravatar image

updated 2012-09-04 23:47:36 -0500

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.

edit flag offensive delete link more

Comments

thanks for your answers. i am sorry i am very new in ros+gazebo, how do i get these controllers?

Nachum gravatar image Nachum  ( 2012-09-04 23:31:08 -0500 )edit

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

Nachum gravatar image Nachum  ( 2012-09-04 23:41:38 -0500 )edit

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.

Lorenz gravatar image Lorenz  ( 2012-09-04 23:44:35 -0500 )edit

didn't get, it just isn't doing any thing. w/o that piece of code after a seccond it spawned

Nachum gravatar image Nachum  ( 2012-09-04 23:46:32 -0500 )edit

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

Nachum gravatar image Nachum  ( 2012-09-05 00:09:42 -0500 )edit

plugin model name: bob

Nachum gravatar image Nachum  ( 2012-09-05 00:10:00 -0500 )edit

I remember that the controller manager actually needs transmissions defined in your URDF. Try adding them similar to the PR2 urdf.

Lorenz gravatar image Lorenz  ( 2012-09-05 22:55:04 -0500 )edit

@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/

Bharadwaj gravatar image Bharadwaj  ( 2013-02-12 17:25:33 -0500 )edit
0

answered 2012-09-04 04:04:17 -0500

joq gravatar image

That depends on how similar your URDF is to the PR2.

You can try it. If it does not work, make your own copy and modify that to suit your needs.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2012-09-04 01:05:35 -0500

Seen: 1,031 times

Last updated: Sep 05 '12