-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent JTAS Error with few Points #55
Prevent JTAS Error with few Points #55
Conversation
This commit partially resolves baxter_interface issue (#53 and #54), where the JTAS would error out if too few points were passed into it. There was a bug in the Bezier library which did not properly check for two points, which this resolves. We can safely remove the additional two point check in the joint trajectory action server based on this. Trac ticket #11669
@rethink-imcmahon Thanks! LGTM! |
I've created a gist to test this Issue / Pull Request:
|
Amazing! |
I decided to add some simple error checking around the Bezier computation, since regardless of whether the library has an error, the JTAS shouldn't die. I do want any error to propegate upward, so the error is passed through rospy.logerr to be seen by the user. |
if dimensions_dict['accelerations']: | ||
first_trajectory_point.accelerations = [0.0] * len(joint_names) | ||
first_trajectory_point.time_from_start = rospy.Duration(0) | ||
trajectory_points.insert( 0, first_trajectory_point ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no spaces around arguments
I honestly don't really understand the math bezier bits to know if your indexing and all is correct, but the rest looks fine (with maybe a slight confusion/redundancy on the velocities / accelerations bit as mentioned). |
a.k.a. good to merge if you've tested it well |
The if only one trajectory point is provided to the Joint Trajectory Action Server, it technically does not count as a valid trajectory. However, we attempt to make do by using the current position as the first point in the trajectory. The second (and only point) is then the provided trajectory pose. The JTAS zeros out both velocities and accelerations for the final position, since it assumes each trajectory ends with a stopped motion. To prevent loss of data, in the case of only 1 trajectory point being provided, this commit copies out the only point's velocities and accelerations into the created initial point consisting of the current joint positions. Having only one trajectory point is an edge case, but one we would like to handle in a logical manner.
…n-few-points Prevent JTAS Error with few Points
This is a rebase and modification of PR #54 for release-1.1.1
where the JTAS would error out if too few points were passed into it.
This fixes a bug in the Bezier library which did not properly check for
two points.
@aginika, could you please take a look at this modified pull request?