simpleactionclient send_goal_and_wait problem
Hello list,
SECOND EDIT:
I still am at a loss why the send_goal_and_wait
and wait_for_result
functions are NOT waiting until a current trajectory is finished as I think they should!
Trying to send multiple trajectories to a robot simulated in gazebo, but the send_goal_and_wait
function does not properly wait for the current trajectory to finish.
So the next trajectory is started while the current is still not finished.
Here the relevant lines from my code:
arm_client = actionlib.SimpleActionClient('boot0/joint_trajectory_controller/follow_joint_trajectory', FollowJointTrajectoryAction)
arm_client.wait_for_server()
arm_goal = FollowJointTrajectoryGoal()
# set an arm_trajectory that takes 5 seconds
arm_goal.trajectory = arm_trajectory
arm_goal.goal_time_tolerance = rospy.Duration(0.0)
arm_client.send_goal_and_wait(arm_goal)
# this call returns almost immediately!
Why doesn't this call take about 5 seconds? Now a next trajectory will start too soon!
EDIT: I now am doing the experiment with the rrbot example from gazebo_ros_demos
.
The result is the same.
The topic /follow_joint_trajectory/result
yields:
header:
seq: 5
stamp:
secs: 204
nsecs: 594000000
frame_id: ''
status:
goal_id:
stamp:
secs: 204
nsecs: 543000000
id: "/trajectory_0-1-204.543"
status: 4
text: ''
result:
error_code: -4
error_string: ''
---
Which also contains also the status shown in /follow_joint_trajectory/status
.
Does this mean: ABORTED=4
and PATH_TOLERANCE_VIOLATED = -4
?
The rrbot always works perfectly, the trajectory is simple, only a single new position is specified, well within its limits.
BUT, I have ONCE seen that the send_goal_and_wait
function DID NOT immediatly returned, and the status was SUCCEEDED and the result was SUCCESSFUL.
What can PATH_TOLERANCE_VIOLATED mean here?
Thanks in advance, Sietse
Have you checked the topic
/follow_joint_trajectory/status
to see if the goal is set to succeded/aborted/preempted as soon as you call the function ? Also the topic/follow_joint_trajectory/result
is only theerror_code
of the goal sent, what is its output ?Thanks, see my edit above.