PR2_controller Plugin Nothing happened in Gazebo
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.
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/