Collision object MOVE modifies object pose before validating shape pose count
Maintainers usually reply within 1 day
Nobody has claimed this yet.
- #3956 by @paneendrakumar0 — closed without merging
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
Research direction
Read moveit_core/planning_scene/src/planning_scene.cpp around processCollisionObjectMove() and trace the MOVE validation and world updates. Add or locate a regression test for a shape pose count mismatch, then run it. Done means the request returns false and leaves the object's global pose and individual shape poses unchanged.
Written by the indexing model from the issue text.
Description
Description
In PlanningScene::processCollisionObjectMove(), the collision object's global pose is updated before validating the number of shape poses provided in the MOVE message.
Affected file:
moveit_core/planning_scene/src/planning_scene.cpp
The object pose is updated first (around line 1976):
const Eigen::Isometry3d object_frame_transform =
world_to_object_header_transform * header_to_pose_transform;
world_->setObjectPose(object.id, object_frame_transform);
However, the number of supplied shape poses is validated only afterward (around lines 1979–1989):
if (!object.primitive_poses.empty() ||
!object.mesh_poses.empty() ||
!object.plane_poses.empty())
{
auto world_object = world_->getObject(object.id);
std::size_t shape_size =
object.primitive_poses.size() +
object.mesh_poses.size() +
object.plane_poses.size();
if (shape_size != world_object->shape_poses_.size())
{
RCLCPP_ERROR(
getLogger(),
"Move operation for object '%s' must have same number of geometry poses. Cannot move.",
object.id.c_str());
return false;
}
}
Consequently, if the shape pose count does not match, the function returns false, but the global object pose has already been modified.
This creates a partial state update: the operation reports failure while the PlanningScene may retain a changed collision object pose.
This can cause inconsistencies between the caller's understanding of the operation result and the collision world state.
Suggested Fix
Validate the supplied shape pose count before calling world_->setObjectPose()
Ideally, all MOVE request validation should be completed before applying any modification to the collision world.
A regression test should verify that a rejected MOVE request leaves both the global object pose and the individual shape poses unchanged.
ROS Distro
Humble
OS and version
Ubuntu 22.04
Source or binary build?
Source
If binary, which release version?
No response
If source, which branch?
No response
Which RMW are you using?
None
Steps to Reproduce
Proposed reproduction steps (not yet executed):
- Create a PlanningScene with a valid robot model.
- Add a collision object named test_object containing two primitive shapes.
- Record the object's initial global pose.
- Construct a moveit_msgs::msg::CollisionObject with:
- id = "test_object"
- operation = CollisionObject::MOVE
- A new global object pose different from the original pose.
- Only one entry in primitive_poses, despite the existing object containing two shapes.
- Submit the MOVE message through PlanningScene::processCollisionObjectMsg().
- Check the returned status.
- Retrieve test_object from the collision world and compare its global pose with the original pose.
The shape pose count mismatch should trigger the validation failure in processCollisionObjectMove().
Expected behavior
When a MOVE request contains an invalid number of shape poses, the operation should be rejected without modifying the existing collision object.
The function should return false, and both the global object pose and individual shape poses should remain unchanged.
Failed MOVE operations should not leave the PlanningScene in a partially modified state.
Actual behavior
Source inspection shows that processCollisionObjectMove() updates the global object pose before checking whether the number of supplied shape poses matches the number of shapes in the existing object.
When the shape pose count does not match, the function logs an error and returns false. However, the earlier call to world_->setObjectPose() has already been executed.
Therefore, the function can report failure while leaving the collision object's global pose modified.
This behavior is supported by the current source code, but a runtime regression test has not yet been executed.
Backtrace or Console output
No response
- Dominant language
- C++
- Stars
- 2.1k
- Forks
- 816
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from moveit/moveit2
-
Failed collision object ADD replacement removes the existing object before validationPossibly taken @paneendrakumar0 claimed this 7 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
moveit/moveit2#3942 · 2 comments ·
Maintainers usually reply within 1 day
-
Missing copy-on-write protection in World::moveShapesInObject and setSubframesOfObjectMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
moveit/moveit2#3940 · 2 comments ·
Maintainers usually reply within 1 day
-
Missing bounds check for collision object subframe namesPossibly taken @huxiaoyi-ovo claimed this 6 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
moveit/moveit2#3939 · 2 comments ·
Maintainers usually reply within 1 day
-
std::max mixes translational (m) and rotational (rad) errors in kdl_kinematics_plugin.cppMay be free again @Rudyy75 claimed this 136 days ago, and no pull request is open. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
moveit/moveit2#3747 · 2 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
mw00/project-maya#877 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
llvm/offload-test-suite#1703 ·
Maintainers usually reply within 1 day
-
backlog bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
EchoTools/nevr-runtime#2154 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
BGI-shenzhen/PopLDdecay#25 ·