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

getting my custom transmissions to work in gazebo

asked 2011-09-15 03:44:55 -0500

Ugo gravatar image

updated 2011-09-15 03:53:06 -0500

I'm having problems getting my model to work in gazebo: when I spawn my model in gazebo, I get a segfault. I'm almost sure it's due to my custom transmissions, because the model is working when the standard pr2 simple_transmission are used.

The backtrace is available here.

My model contains custom transmissions (which are almost copies of the simple_transmission.cpp, as you can see here.

I uploaded the generated model here.

Those transmissions are working on the real robot, but not in Gazebo.

Any ideas?

edit retag flag offensive close merge delete


It appears the problem is coming from the iteration on the actuator map in ControllerManager::publishMechanismStatistics(): the for (ActuatorMap::const_iterator it = model_.hw_->actuators_.begin(); it != model_.hw_->actuators_.end(); ++i, ++it) returns a segfault on the 3rd element.
Ugo gravatar image Ugo  ( 2011-09-15 22:18:51 -0500 )edit
If I comment out the call to publishMechanismStatistics() in the ControllerManager::update() function then the simulation seems to be working fine.
Ugo gravatar image Ugo  ( 2011-09-15 22:30:36 -0500 )edit
The root of the problem is that the pr2_gazebo_plugins/src/gazebo_ros_controller_manager.cpp instantiates a ''''pr2_hardware_interface::Actuator" object (line 470), and not my custom actuator (which inherits from the pr2 Actuator class). Is it not possible to have a custom actuator?
Ugo gravatar image Ugo  ( 2011-10-24 23:52:56 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-10-25 03:24:13 -0500

Ugo gravatar image

Ok, I solved it by creating my own implementation of the pr2_gazebo_plugins/src/gazebo_ros_controller_manager.cpp.

This is available in the sr_gazebo_plugins package.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2011-09-15 03:44:55 -0500

Seen: 293 times

Last updated: Oct 25 '11