Skip to content

/attached_collision_object endless loop #552

Open

Description

@zplizzi

Description

I am trying to attach an object to a robot arm. I send a message over the /attached_collision_object topic. As a result, the object begins being published in the robot_state: attached_collision_objects: section of the /move_group/monitored_planning_scene, with diff = False. The object shows up in Rviz as expected. However, in the console where I launched my robot launch file (with MoveIt, Rviz, etc), I get an endless stream of messages of the type

[ INFO] [1500398010.982460498]: Attached object 'test' to link 'fingertip_link'

It seems to me that Rviz is trying to apply every message from /move_group/monitored_planning_scene as a new attached object, vs recognizing that the object already exists.

As a result (I think?), collision detection during path planning on that object is broken since the object is deleted faster than the planner can plan a trajectory.

Your environment

  • ROS Distro: Kinetic
  • OS Version: e.g. Ubuntu 16.04
  • Binary: 1.3.1-0xenial-20170615-105244-0800

Activity

  1. zplizzi commented on Jul 18, 2017

    @zplizzi
    Author

    I think I understand the problem a bit better. When adding a normal collision object (unattached), there will be a single message on /move_group/monitored_planning_scene containing the new object, and diff=True. All future messages also have diff=True, and don't mention the object. This appears to work fine, as it should.

    However, when adding an attached collision object, the object is published in every future /move_group/monitored_planning_scene message, with diff=False in the robot_state part of that message. Then, apparently whoever is listening to that message (Rviz plugin?) doesn't handle the diff=False properly, and re-creates the object each message.

    So, it seems like there's two approaches to a solution: either a) treat attached objects like the unattached, and only publish them once with diff=True, or b) fix the Rviz plugin to handle diff=False messages properly.

  2. v4hn commented on Jul 18, 2017

    @v4hn
    Contributor

    First off, thanks for looking into this. 👍

    At first glance I would think publishing the robot state always as is_diff: false is a bug in this case, but I didn't investigate this thoroughly.
    It could be that some other code behaves wrongly if it receives a "diff" RobotState and/or that it is non-trivial to publish the diffs for the RobotState class.

    Still, my preferred solution would work towards your proposal "a)".

    As a result (I think?), collision detection during path planning on that object is broken since the object is deleted faster than the planner can plan a trajectory.

    The planner operates on a locked planning scene, so this is most likely not the case.

  3. zplizzi commented on Jul 18, 2017

    @zplizzi
    Author

    After some more poking around, it doesn't look like the attached_object code (yet) supports doing diffs. The collision objects have the collision_detection::WorldDiff class which handles this, but I couldn't find an analog for the attached collision objects (in the Kinetic branch, at least). That being said, this is the first time I've looked at this code, so I easily could have missed something.

  4. v4hn commented on Jul 19, 2017

    @v4hn
    Contributor
  5. RoBoLog commented on Aug 9, 2017

    @RoBoLog

    @zplizzi and @v4hn I have the same issue. I am doing the pr2 moveit_tutorials planning_scene_ros_api_tutorial. The object appears and gets connected to the gripper. But then it does not get detached. and along the way between the processes of attach and detach I get a stream of messages
    .............................................................................

    [ INFO] [1502275537.591629864]: Attached object 'box' to link 'r_wrist_roll_link'
    [ INFO] [1502275537.652572290]: Detaching the object from the robot and returning it to the world.
    [ERROR] [1502275537.653146469]: Found empty JointState message ``      **<-- also getting this**
    
    [ERROR] [1502275537.653223449]: The specified RobotState is not marked as is_diff. The request to modify the object 'box' is not supported. Object is ignored.
    [ INFO] [1502275537.815513782]: Attached object 'box' to link 'r_wrist_roll_link'
    [ INFO] [1502275538.071848487]: Removing world object with the same name as newly attached object: 'box'
    [ INFO] [1502275538.071963773]: Attached object 'box' to link 'r_wrist_roll_link'
    [ INFO] [1502275539.831450395]: Attached object 'box' to link 'r_wrist_roll_link'
    [ INFO] [1502275540.087312698]: Attached object 'box' to link 'r_wrist_roll_link'
    [ INFO] [1502275540.343626912]: Attached object 'box' to link 'r_wrist_roll_link'
    

    I have checked the same tutorial in indigo. it works inspite of the error 'Object is ignored'. and also the stream of messages coming. The box disappears.
    Any suggestions...? please...

  6. v4hn commented on Aug 9, 2017

    @v4hn
    Contributor

    @Vonstafenberg The repeated Attached object ... info messages can be safely ignored and should not
    cause any problem.

    But then it does not get detached. [...] I have checked the same tutorial in indigo. it works

    If this is the case, please report this as a bug in moveit_tutorials with a more detailed explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions