Repository navigation
enforce joint bounds for start state validation - #290
Conversation
davetcoleman
left a comment
There was a problem hiding this comment.
Overall makes sense, thanks for implementing this!
| ROS_WARN_NAMED("traj_execution", "Failed to validate trajectory: couldn't receive full current joint state within 1s"); | ||
| return false; | ||
| } | ||
| current_state->enforceBounds(); |
There was a problem hiding this comment.
Could you add a comment why this is necessary? Shouldn't the current state already be within bounds?
There was a problem hiding this comment.
I'm not sure actually. If this is guaranteed I'm happy to remove that line.
There was a problem hiding this comment.
I followed this call down to RevoluteJointModel::enforcePositionBounds() - so the comment should clarify that it isn't just enforcing bounds but also normalizing continuous joints
| current_state->enforceBounds(); | ||
|
|
||
| // build a RobotState that can be used to compare current_state and start_state with enforced bounds | ||
| robot_state::RobotState start_state(*current_state); |
There was a problem hiding this comment.
rename to something like bounded_start_state to make more clear
| { | ||
| ROS_ERROR_STREAM_NAMED("traj_execution", "Unknown joint in trajectory: " << joint_names[i]); | ||
| return false; | ||
| } |
There was a problem hiding this comment.
because the call to start_state.setVariablePositions above already ensures that the joint exists.
| ROS_ERROR_STREAM_NAMED("traj_execution", "Unknown joint in trajectory: " << joint_names[i]); | ||
| return false; | ||
| } | ||
| const robot_model::JointModel *jm_start= start_state.getJointModel(joint_names[i]); |
ccf9adc to
b05caa7
Compare
|
@davetcoleman I addressed the feedback. |
| ROS_WARN_NAMED("traj_execution", "Failed to validate trajectory: couldn't receive full current joint state within 1s"); | ||
| return false; | ||
| } | ||
| current_state->enforceBounds(); |
There was a problem hiding this comment.
I followed this call down to RevoluteJointModel::enforcePositionBounds() - so the comment should clarify that it isn't just enforcing bounds but also normalizing continuous joints
| { | ||
| ROS_ERROR_STREAM_NAMED("traj_execution", "Unknown joint in trajectory: " << joint_names[i]); | ||
| return false; | ||
| } |
|
|
||
| try | ||
| { | ||
| bounded_start_state.setVariablePositions(joint_names, positions); |
There was a problem hiding this comment.
This will not work as soon as the trajectory is split into parts because several controllers will be used for different subsets of joints. I will suggest an alternative.
There was a problem hiding this comment.
that's what the for-loop around this is for...
I don't see any mistake here.
There was a problem hiding this comment.
Sorry. I missed yesterday, that the list of joint_names is provided too. I was thinking that all variable positions would be tried to be assigned at once.
|
I reworked this PR. @v4hn, please could you give it another try on a real robot with a continuous joint? |
|
I rebased this PR for Kinetic: #292. |
Seems like a unit test with the PR2 would make more sense |
Do we have a moveit_config for PR2 somewhere? |
v4hn
left a comment
There was a problem hiding this comment.
Yes, this resolves the problem too.
I did not notice the JointModel can enforce bounds on external values.
If we ever implement the more sophisticated noise handling for individual joints, I think I would still prefer my approach, but yours is faster for sure. :)
It seems I cannot approve my own pull-request, but I approve this anyway.
This should be merged into indigo-devel and kinetic-devel before tomorrow!
|
I would propose to deal with the unit test after the release. |
Without this, unlimited joints might get out of the bounds in the trajectory and will fail the validation.
df00b48 to
c8afab7
Compare
|
I still do not believe this deprecates #287 |
enforce joint bounds+normalization in start state validation this is a cherry-pick of #290 from Indigo
Without this, unlimited joints might get out of the bounds
in the trajectory and will fail the validation.
This resolves #283. In theory this deprecates #287 .
Feel free to improve the request, I pushed the request-branch to this repo.
The patch has been verified on our PR2.
Should be picked to j/k