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

pr2_controller_interface inheritance

asked 2012-10-11 01:07:03 -0500

arzhed gravatar image

updated 2012-10-14 22:41:07 -0500

Hi everyone!

Using a differential wheeled robot, I'm trying to clean up my controller programs : I used a controller for each wheel in two different package, whereas they are very very similar ! But now, the left wheel controller inherits from the WheelController class, which inherits from the pr2_controller_interface::Controller class (as in the tutorials).

I built the library for the left wheel controller, and specified the base class was the WheelController class (with PLUGINLIB_DECLARE_CLASS and in the controller_plugins.xml file). I got the following when i try to load the controller after running my robot in gazebo :

Could not load class wheelcontroller/LeftWheelControllerPlugin: According to the loaded plugin descriptions the class wheelcontroller/LeftWheelControllerPlugin with base class type pr2_controller_interface::Controller does not exist.

Is the problem that my controller does not directly inherit from the pr2_controller_interface::Controller class? I tried specifying that class instead of the WheelController class, but it still fails.

Any idea?

UP ! (again)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-10-14 23:59:59 -0500

Lorenz gravatar image

updated 2012-10-15 00:01:23 -0500

Did you declare your controller plugin in a pluginlib xml file and register it in your manifest's export section? Have a look here, section 5 for more information.

Btw. at least on the PR2, there exists only one controller plugin that controls all 4 casters instead of having one controller for each motor or caster.

edit flag offensive delete link more

Comments

I did, but I didnt know what to declare as "base_class" : it should be my WheelController class that inherits from pr2_controller_interface, but it caused errors, so I declared pr2_controller_interface as base class, neither did it work. I'm gonna go with only 1 controler plugin as you said, thanks!

arzhed gravatar image arzhed  ( 2012-10-15 02:43:45 -0500 )edit
1

The error above indicates that the class LeftWheelControllerPlugin hasn't been declared properly either with the macro PLUGINLIB_DECLARE_CLASS or the xml file. As base class, you should always specify the interface you are implementing since that is the information pluginlib needs.

Lorenz gravatar image Lorenz  ( 2012-10-15 02:46:23 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2012-10-11 01:07:03 -0500

Seen: 427 times

Last updated: Oct 15 '12