joint_trajectory_controller dropping points

asked 2018-10-13 12:13:53 -0500

dhindhimathai gravatar image

updated 2018-10-13 12:15:11 -0500

I'm on Ubuntu 14.04 with ROS Indigo.

I am using joint_trajectory_controller to control a 7 DoF robot. After sending a control_msgs::FollowJointTrajectoryGoal to joint_trajectory_controller through an actionlib::SimpleActionClient<control_msgs::FollowJointTrajectoryAction>, I often experience the following warning:

[ WARN] [1424969414.252450021]: Dropping all 1 trajectory point(s), as they occur before the current time. Last point is 0.008s in the past.

An outline of my code is the following:

// Action client
actionlib::SimpleActionClient<control_msgs::FollowJointTrajectoryAction>jt_client("/robot/joint_trajectory_controller/follow_joint_trajectory/", true);

// Creating goal
control_msgs::FollowJointTrajectoryGoal goalmsg;

// Creating trajectory messages and point
trajectory_msgs::JointTrajectoryPoint point;
trajectory_msgs::JointTrajectory traj;

// Push back joint names

// Clearing as I am reusing point and traj

// Creating the trajectory point
point.positions.push_back(<<some value>>);
point.positions.push_back(<<some value>>);

// Setting time from start of the point and pushing to traj
point.time_from_start = ros::Duration(1, 0);

// Setting trajectory header
traj.header.stamp = ros::Time::now() + ros::Duration(0, 1000000);

// Setting trajectory in goal msgs
goalmsg.trajectory = traj;

// Sending to joint_trajectory_controller

I noticed that the trajectory point is dropped if I set the time_from_start of the point below 1 second.

Can someone explain why this happens? Am I doing anything wrong? I would prefer a much smaller execution time than 1 second for the point.

Thank you so much in advance.

edit retag flag offensive close merge delete