Skip to content

Remove of collision Object when attaching it with apply planning scene service - #148

Merged
rhaschke merged 2 commits into
moveit:indigo-develfrom
Jntzko:attachedObject
Sep 22, 2016
Merged

rhaschke merged 2 commits into
moveit:indigo-develfrom
Jntzko:attachedObject

Conversation

@Jntzko

@Jntzko Jntzko commented Aug 24, 2016

Copy link
Copy Markdown
Contributor

This is part of the issue #103.

The current state is that the collision object will be removed from the planning scene when attaching
it to the robot with the asynchronous attachObject function of the move_group_interface.

So we want the same behavior with the synchronous apply planning scene service.

In this effect we added two error messages for the case that the roboState is_diff is not set.

robot_state::robotStateMsgToRobotState(*ftf_, state, *kstate_);
robot_state::robotStateMsgToRobotState(*ftf_, state_no_attached, *kstate_);

// we add object types to the planning scene, if any are specified

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you replace this comment with a new one?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment explained the old patch.
The new code calls processAttachedCollisionObjectMsg and does not add types here anymore.
The new loop is pretty much self-explaining imho.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. but in general i think we need more comments, not less

@v4hn

v4hn commented Aug 25, 2016 •

Copy link
Copy Markdown
Contributor

First of all, I helped writing this patch. So +1 (after the comment I asked for has been added).

processAttachedCollisionObjectMsg contains some nice magic that is currently not triggered by sending PlanningScene updates.
I suppose it makes sense to use the different methods that process incoming messages of type PlanningScene, RobotState, PlanningSceneWorld, CollisionObject and AttachedCollisionObject
on top of each other.
The setCurrentState method, that handles incoming RobotStates didn't call processAttachedCollisionObjectMsg though and left adding the attached bodies to robot_state::robotStateMsgToRobotState. This function however, does now know about the PlanningScene anymore and therefore falls short of several nice features, e.g. attaching a collision object with its name only, if it already exists in the planning scene.

The patch proposes to pass in a robot state without attached bodies to robotStateMsgToRobotState and only afterwards process the attached bodies.
As far as I'm aware of this preserves current behavior but allows to send PlanningScenes to the monitor (via /planning_scene as well as ApplyPlanningScene with an attached body that has only its name specified, if the object already exists in the scene.

@davetcoleman

Copy link
Copy Markdown
Member

I think @rhaschke should take a look - you guys understand the intricacies of the PSM better than me

@rhaschke rhaschke self-assigned this Aug 29, 2016
Yannick Jonetzko added 2 commits September 20, 2016 15:44
…e service

This is part of the issue moveit#103.

The current state is that the collision object will be removed from the planning scene when attaching
it to the robot with the asynchronous attachObject function of the move_group_interface.

So we want the same behavior with the synchronous apply planning scene service.

To reach this we need to call the processAttachedCollisionObjectMsg, the same function as in attachObject,
to attach the object to the robot and not in the robotStateMsgsToRobotState, because we can't get access to
the collision objects in the robot state. Therefore we give this method a scene without the attached objects
and attach them with the process funcion afterwards.

In this effect we add a error message for the case that the roboState is_diff is false and someone uses
a different operation than ADD.
This case happens if the robotState is_diff is not set and the object should be removed.
In this case all attached objects are not considered anyway so nothing happens, but there
should be a error message.
@v4hn

v4hn commented Sep 21, 2016

Copy link
Copy Markdown
Contributor

@rhaschke: @Jntzko addressed my comment yesterday. This is ready for further review/merge.

@rhaschke
rhaschke merged commit 1a812b0 into moveit:indigo-devel Sep 22, 2016
@rhaschke

Copy link
Copy Markdown
Contributor

Cherry-picked to J/K.

JafarAbdi pushed a commit to JafarAbdi/moveit that referenced this pull request Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants