Ask Your Question
3

PR2_controller Plugin Nothing happened in Gazebo

asked 2012-12-05 05:12:28 -0500

Xiaolong gravatar image

updated 2012-12-14 07:48:19 -0500

hsu gravatar image

Hello all,

I followed the tutorial pr2_mechanism/Tutorials/Running a real-time Cartesian/controller exactly to write a pr2 controller. Everything seems fine except nothing happened in the gazebo simulator. Could anyone help me out? I describe what I have done as follows:

package name: my_controller_cart_pkg

Plugin class defined:

namespace my_controller_ns{
class MyCartControllerClass: public pr2_controller_interface::Controller
{....
}

Plugin declaration in src/my_controller_cart.cpp:

PLUGINLIB_DECLARE_CLASS (my_controller_cart_pkg, MyCartControllerClass,
                         my_controller_ns::MyCartControllerClass,
                         pr2_controller_interface::Controller)

Actually, I also tried PLUGINLIB_REGISTER_CLASS(MyCartControllerClass, my_controller_ns::MyCartControllerClass, pr2_controller_interface::Controller), but it didn't work.

controller_plugins.xml:

<library path="lib/libmy_controllers">
  <class name="my_controller_cart_pkg/MyCartControllerClass" 
         type="my_controller_ns::MyCartControllerClass"           
         base_class_type="pr2_controller_interface::Controller" />
</library>

cart_controller.yaml:

my_tutorial_controller:
    type: my_controller_cart_pkg/MyCartControllerClass
    root_name: torso_lift_link
    tip_name: r_gripper_tool_frame

my_controller_cart.launch:

<launch>
   <rosparam file="$(find my_controller_cart_pkg)/cart_controller.yaml" command="load" />

   <node pkg="pr2_controller_manager" type="spawner" args="my_tutorial_controller" name="my_controller_cart_spawner" />
</launch>

After I launched the gazebo simulator, I typed:

rosrun pr2_controller_manager pr2_controller_manager list-types

Then I can see:

JointGravityController

JointPendulumController

ethercat_trigger_controllers/MultiTriggerController

ethercat_trigger_controllers/ProjectorController

ethercat_trigger_controllers/TriggerController

my_controller_cart_pkg/MyCartControllerClass

...

After that, I launched my my_controller_cart.launch file. I run:

rosrun pr2_controller_manager pr2_controller_manager list

I received:

base_controller ( running )

base_odometry ( running )

head_traj_controller ( running )

l_arm_controller ( running )

l_gripper_controller ( running )

laser_tilt_controller ( running )

my_tutorial_controller ( running )

r_arm_controller ( running )

r_gripper_controller ( running )

torso_controller ( running )

my_tutorial_controller plugin is running. But nothing happened in gazebo simulator. Could anyone help me out? Thank you in advance.

edit retag flag offensive close merge delete

Comments

I noticed a similar question posted previously, but it didn't solve my problem. http://answers.ros.org/question/45279/pr2-writing-a-realtime-joint-controller/

Xiaolong gravatar image Xiaolong  ( 2012-12-06 04:42:30 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-12-06 05:32:20 -0500

Xiaolong gravatar image

updated 2012-12-10 05:17:09 -0500

I happened to change the cart_controller.yaml file to control the left arm. It works!

my_tutorial_controller:
    type: my_controller_cart_pkg/MyCartControllerClass
    root_name: torso_lift_link
    tip_name: l_gripper_tool_frame

Now I want to know why the right arm doesn't work?

edit flag offensive delete link more

Comments

Wow, yes it works on the left arm too for the tutorial that I was stuck on.

ccm gravatar image ccm  ( 2012-12-06 18:24:46 -0500 )edit

Did you figure out why it doesn't work on the right arm?

Xiaolong gravatar image Xiaolong  ( 2012-12-07 07:51:51 -0500 )edit

I found that if I kill the right_arm_controller, it and load my_controller_name afterwards, the right arm works. @.@ perhaps the default controller was interfering?

ccm gravatar image ccm  ( 2013-02-22 15:08:00 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

4 followers

Stats

Asked: 2012-12-05 05:12:28 -0500

Seen: 307 times

Last updated: Dec 14 '12