Ask Your Question

Unable to load Position Trajectory Controller

asked 2016-07-04 04:50:55 -0600

rohin gravatar image

I want to control and drive a real 6-DOF robotic arm.

I have setup my Moveit configuration files using joint_trajectory_controller and MoveItSimpleControllerManager. Here is my moveit controllers.yaml file:

   - name: /nymblebot/position_trajectory_controller
    action_ns: follow_joint_trajectory
    type: FollowJointTrajectory
    default: true
      - base_swivel
      - arm_joint
      - elbow_joint
      - wrist_pitch
      - wrist_yaw
      - wrist_roll

Then I have setup my ros_control files along with hardware interfaces. Here is my ros_control hardware_controllers.yaml file:

  loop_hz: 30
  cycle_time_error_threshold: 0.01

# Settings for ros_control hardware interface
      - base_swivel
      - arm_joint
      - elbow_joint
      - wrist_pitch
      - wrist_yaw
      - wrist_roll

# Joint Trajectory Controller -------------------------------
# For detailed explanations of parameter see
   type: position_controllers/JointTrajectoryController
# These joints can likely just be copied from the hardware_interface list above

      - base_swivel
      - arm_joint
      - elbow_joint
      - wrist_pitch
      - wrist_yaw
      - wrist_roll

# Publish all joint states ----------------------------------
# Creates the /joint_states topic necessary in ROS
  type:         joint_state_controller/JointStateController
  publish_rate: 50

My control interface is based on Adolfo's ROSCON'14 talk. In my main executable, I instantiate a hardware interface class of my robot. Then I instantiate a control_loop class which has read(), write() as member functions and pulls info out from ROS parameter server.

Also I form an instance of the controller manager. Following this I have my main control loop which proceeds as: 1. read() 2.update() 3.write()

Unfortunately the process crashes soon after the 2.update() command. And only the joint_state_controller gets loaded.

Started ['joint_state_controller'] successfully
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/controller_manager/controller_manager", line 65, in <module>
  File "/opt/ros/indigo/lib/python2.7/dist-packages/controller_manager/", line 86, in start_controller
    return start_stop_controllers([name], True)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/controller_manager/", line 107, in start_stop_controllers
    resp =, stop, strictness))
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/impl/", line 525, in call
    raise ServiceException("transport error completing service call: %s"%(str(e)))

rospy.service.ServiceException: transport error completing service call: unable to receive data from sender, check sender's logs for details
[nymblebot/nymblebot_hardware_interface-8] process has died [pid 8763, exit code -11, cmd /home/rohin/catkin_ws/devel/lib/hardware/nymble_hw_control_loop __name:=nymblebot_hardware_interface __log:=/home/rohin/.ros/log/4856bd5a-41c5-11e6-b1dc-20689d39eac5/nymblebot-nymblebot_hardware_interface-8.log].
log file: /home/rohin/.ros/log/4856bd5a-41c5-11e6-b1dc-20689d39eac5/nymblebot-nymblebot_hardware_interface-8*.log
[nymblebot/ros_control_controller_manager-7] process has died [pid 8755, exit code 1, cmd /opt/ros/indigo/lib/controller_manager/controller_manager spawn joint_state_controller position_trajectory_controller __name:=ros_control_controller_manager __log:=/home/rohin/.ros/log/4856bd5a-41c5-11e6-b1dc-20689d39eac5/nymblebot-ros_control_controller_manager-7.log].
log file: /home/rohin/.ros/log/4856bd5a-41c5-11e6-b1dc-20689d39eac5/nymblebot-ros_control_controller_manager-7*.log

For reference here is my main control loop in my executable:

int main(int argc, char **argv)
    // Setup ROS
    ros::init(argc, argv, "nymblebot_hw_interface");
    ros::NodeHandle n;
// NOTE: We run the ROS loop in a separate thread as external calls such
// as service callbacks to load controllers can block the (main) control loop
ros::AsyncSpinner spinner(2);

// Create the hardware interface specific to your robot
boost::shared_ptr<NymbleHW> nymble_hw_interface (new NymbleHW(n));

// Start the control loop
Nymble_HW_Loop control_loop(n, nymble_hw_interface);

boost::shared_ptr<controller_manager::ControllerManager> controller_manager_ ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-07-06 01:40:08 -0600

i don't immediately see the problem, but finding out what crashes should be fairly straightforward if you run things in GDB as described in How to Roslaunch Nodes in Valgrind or GDB.

edit flag offensive delete link more


Thanks! I found out that I was not setting an initial size to a std::vector which was causing the program to crash.

rohin gravatar image rohin  ( 2016-09-30 12:49:46 -0600 )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



Asked: 2016-07-04 04:50:55 -0600

Seen: 644 times

Last updated: Jul 06 '16