Dropping all 1 trajectory point(s), as they occur before the current time. last time 580.02s
Hi. While trying to use FollowJointTrajectory, running from another system, setting the ROS_MASTER_URI to be the robot's IP. I am encountering a problem where trying to tilt the arm fails with either
1) Dropping all 1 trajectory point(s), as they occur before the current time. last time 580.02s.
or
2) [ERROR] Unexpected exception caught when initializing trajectory from ROS message data.
I guess it has to do with the difference of times on my PC and on the robot?
edit: The code is working perfectly fine on the gazebo simulation.
the code I use:
_armClient.sendGoal(setGoalTja(rotate1,shoulder1,shoulder2,rotate2,shoulder3,wrist_joint));
control_msgs::FollowJointTrajectoryGoal setGoalTja(double rotate1, double shoulder1, double shoulder2, double rotate2, double shoulder3, double wrist_joint) {
control_msgs::FollowJointTrajectoryGoal goal;
trajectory_msgs::JointTrajectoryPoint point;
goal.trajectory.header.frame_id = "";
goal.trajectory.header.stamp = ros::Time::now();
goal.trajectory.joint_names.push_back("rotation1_joint");
goal.trajectory.joint_names.push_back("shoulder1_joint");
goal.trajectory.joint_names.push_back("shoulder2_joint");
goal.trajectory.joint_names.push_back("rotation2_joint");
goal.trajectory.joint_names.push_back("shoulder3_joint");
goal.trajectory.joint_names.push_back("wrist_joint");
point.time_from_start = ros::Duration(10.0);
point.accelerations.resize(6);
point.accelerations[4] = 2;
point.positions.resize(goal.trajectory.joint_names.size());
point.positions[0] = rotate1;
point.positions[1] = shoulder1;
point.positions[2] = shoulder2;
point.positions[3] = rotate2;
point.positions[4] = shoulder3;
//point.positions[5] = joints[5]+pos;
point.positions[5] = wrist_joint; //pos
goal.trajectory.points.push_back(point);
return goal;
}
As you note yourself: time synchronisation between the robot and the PC would be something to check.
If you mean time synchronisation as checking that the robot's and the PC's system has the same time. So yes I checked that, and that didn't help.
Can you describe how you checked that? (At least) millisecond synchronisation would be required, so without specialised tools/infrastructure this is impossible to achieve.
In the FollowJointTrajectory I set Time_From_Start to be a several seconds so syncing by miliseconds wont be necessary I guess.
That doesn't seem to answer my question? In general when working with multi-host setups in ROS, having synchronised clocks is advisable, as anything with timestamps cannot be compared or data interpolated properly without that. TF lookups failing is one of the other problems. Not saying it's the ..
.. cause here, but worthwhile to check in any case.
Note btw that this is not necessarily ROS-specific: distributed control systems without synchronised clocks are a lot more complex and require different approaches.
How would you recommend to sync my PC's time with the robot's?
Chrony is being used a lot (see here) or you could go for plain
ntp
.