-
Notifications
You must be signed in to change notification settings - Fork 938
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
improve [get|set]JointValueTarget in python wrapper #858
Conversation
@willcbaker Please review. |
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.
This has been on pause for some time.
I think your changes really make sense, I'm just a little hesitant to make those setJointValueTarget() functions deprecated right away since they are really convenient and could be 'fixed' easily.
moveit_ros/planning_interface/move_group_interface/src/wrap_python_move_group.cpp
Show resolved
Hide resolved
@@ -400,7 +399,7 @@ class MoveGroupInterface | |||
|
|||
If these values are out of bounds then false is returned BUT THE VALUES | |||
ARE STILL SET AS THE GOAL. */ | |||
bool setJointValueTarget(const sensor_msgs::JointState& state); | |||
MOVEIT_DEPRECATED bool setJointValueTarget(const sensor_msgs::JointState& state); |
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.
Why not just change the implementation to match setJointValueTarget(const std::map<std::string, double>& variable_values)
? It would probably make sense to use a setJointValueTarget(const std::vector<std::string>& variable_names, const std::vector<double>& variable_names)
for that.
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.
There is already a setJointValueTarget(const std::map<std::string, double>& variable_values)
.
I'm not sure about your intention.
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.
My intention is to keep support for setting target states from robot trajectory waypoints directly (from both message and class types). I don't get why setJointValueTarget(const sensor_msgs::JointState& state)
should be deprecated only because there can be joints that are not member of the group. IMO this function should just ignore non-member joints just like setJointValueTarget(const std::map<std::string, double>& variable_values)
does.
Alternatively I would suggest adding a setJointValueTarget(const std::vector<std::string>& variable_names, const std::vector<double>& variable_names)
function that is more convenient to use than the map.
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.
My intention is to keep support for setting target states from robot trajectory waypoints directly
Makes sense. Please feel free to augment to this PR branch.
@@ -362,7 +361,7 @@ class MoveGroupInterface | |||
|
|||
If these values are out of bounds then false is returned BUT THE VALUES | |||
ARE STILL SET AS THE GOAL. */ | |||
bool setJointValueTarget(const robot_state::RobotState& robot_state); | |||
MOVEIT_DEPRECATED bool setJointValueTarget(const robot_state::RobotState& robot_state); |
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.
I agree that these functions should not set any positions other than those inside the corresponding joint model group.
Rather than making these deprecated I would really prefer changing the implementation to just use RobotState::copyJointGroupPositions()
or RobotState::getVariablePositions()
selectively.
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.
I my opinion, the RobotState shouldn't be exposed by move-group methods.
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.
In that case setStartState(robot_state::RobotState)
should be deprecated as well. But does this really improve usability?
a17dac0
to
348bc87
Compare
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.
@henningkayser LGTM.
...ng_interface/move_group_interface/include/moveit/move_group_interface/move_group_interface.h
Show resolved
Hide resolved
Iirc I had added robotstate python bindings a while back to expose the robot state methods as at the time it was one of the only ways to get the current full state of the robot and set multidof joint goals. |
@willcbaker so you agree with this changes or not? |
I haven't had much time to play around with this yet, but it from what I can tell by reading: RE: The get target robot state being protected:
I had also been using the robot state functions to create robot markers from robot state messages, I'm sure there are other ways to do this, but it was a nice to have at this level. (was heading down a route for more interactive planning other than the rviz gui, future work to come!) RE: Deprecating robot state joint value setter:
|
return a variable values matching to setJointValueTarget()
allowing to set joint values for non-group joints is not a good idea
@willcbaker Your described behavior would still be possible if the robot state is removed from the interface. You just have to pass the joint states instead of the full
I think this wouldn't be possible anymore. But what is the use case for this? To my knowledge it's not possible to plan for different multi-dof joint poses via the MoveGroupInterface. |
348bc87
to
475f48f
Compare
….set_state_value_target()
I rebased and targeted this PR against |
@rhaschke do you want this to be cherry-picked into other branches as well? |
As this changes API, I wouldn't backport this to any other branch. @henningkayser, thanks for merging. |
As pointed out in #845, the signature and semantics of
getJointValueTarget()
doesn't match the one of the corresponding setter, which renders both functions rather useless. As I pointed out in #845 (comment) a proper solution of this issue, should consider:MoveGroupInterface::getJointValueTarget(std::vector<double>&)
that matches the correspondingsetJointValueTarget(const std::vector<double>&)
method and should useRobotState::copyJointGroupPositions(const JointModelGroup*, std::vector<double>&)
to do so.MoveGroupInterface::getJointValueTarget()
(currently returning the full
RobotState
) andMoveGroupInterface::getJointStateTarget()
to correctly reflect the semantics of returning the full robot state.getTargetRobotState()
, both inMoveGroupInterface
andMoveGroupInterfaceImpl
.setJointValueTarget(const robot_state::RobotState&)
andsetJointValueTarget(const sensor_msgs::JointState&)
, which allow to set joint values that are not member of theJointModelGroup
.This PR considers all of them as well as a sanity check in some other joint setters.