-
Notifications
You must be signed in to change notification settings - Fork 159
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
ComputeIK fails when any collision objects are in the scene. #650
Comments
Probably this is related to your setup. Is there any error message from |
No other error messages on the log as far as I can see, no failure comments in the rviz GUI (screenshot below): Here are the robot arm URDF and SRDF if they are of any help: <?xml version="1.0" encoding="UTF-8"?>
<!--This does not replace URDF, and is not an extension of URDF.
This is a format for representing semantic information about the robot structure.
A URDF file must exist for this robot as well, where the joints and the links that are referenced are defined
-->
<robot name="fairino3_v6_robot">
<!--GROUPS: Representation of a set of joints and links. This can be useful for specifying DOF to plan for, defining arms, end effectors, etc-->
<!--LINKS: When a link is specified, the parent joint of that link (if it exists) is automatically included-->
<!--JOINTS: When a joint is specified, the child link of that joint (which will always exist) is automatically included-->
<!--CHAINS: When a chain is specified, all the links along the chain (including endpoints) are included in the group. Additionally, all the joints that are parents to included links are also included. This means that joints along the chain and the parent joint of the base link are included in the group-->
<!--SUBGROUPS: Groups can also be formed by referencing to already defined group names-->
<group name="fairino3_v6_group">
<joint name="j1"/>
<joint name="j2"/>
<joint name="j3"/>
<joint name="j4"/>
<joint name="j5"/>
<joint name="j6"/>
<joint name="eef"/>
<chain base_link="base_link" tip_link="end_effector"/>
</group>
<!--GROUP STATES: Purpose: Define a named state for a particular group, in terms of joint values. This is useful to define states like 'folded arms'-->
<group_state name="pos1" group="fairino3_v6_group">
<joint name="j1" value="2.4468"/>
<joint name="j2" value="-1.6214"/>
<joint name="j3" value="1.5465"/>
<joint name="j4" value="-1.5877"/>
<joint name="j5" value="-1.6368"/>
<joint name="j6" value="0"/>
</group_state>
<group_state name="pos2" group="fairino3_v6_group">
<joint name="j1" value="0.8606"/>
<joint name="j2" value="-1.4189"/>
<joint name="j3" value="1.5465"/>
<joint name="j4" value="-1.7227"/>
<joint name="j5" value="-1.5018"/>
<joint name="j6" value="0"/>
</group_state>
<end_effector name="end_effector" parent_link="end_effector" group="fairino3_v6_group" />
<!--DISABLE COLLISIONS: By default it is assumed that any link of the robot could potentially come into collision with any other link in the robot. This tag disables collision checking between a specified pair of links. -->
<disable_collisions link1="base_link" link2="shoulder_link" reason="Adjacent"/>
<disable_collisions link1="base_link" link2="upperarm_link" reason="Never"/>
<disable_collisions link1="forearm_link" link2="upperarm_link" reason="Adjacent"/>
<disable_collisions link1="forearm_link" link2="wrist1_link" reason="Adjacent"/>
<disable_collisions link1="shoulder_link" link2="upperarm_link" reason="Adjacent"/>
<disable_collisions link1="shoulder_link" link2="wrist1_link" reason="Never"/>
<disable_collisions link1="wrist1_link" link2="wrist2_link" reason="Adjacent"/>
<disable_collisions link1="wrist1_link" link2="wrist3_link" reason="Never"/>
<disable_collisions link1="wrist2_link" link2="wrist3_link" reason="Adjacent"/>
</robot> <?xml version="1.0" encoding="utf-8"?>
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com)
Commit Version: 1.5.1-0-g916b5db Build Version: 1.5.7152.31018
For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
<robot
name="fairino3_v6_robot">
<link
name="base_link">
<inertial>
<origin
xyz="-0.00049027 -0.00045095 0.032527"
rpy="0 0 0" />
<mass
value="0.78393" />
<inertia
ixx="0.0013854"
ixy="1.1455E-05"
ixz="-1.0642E-05"
iyy="0.0013849"
iyz="-9.7435E-06"
izz="0.001977" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/base_link.STL" />
</geometry>
<material
name="">
<color
rgba="0.89804 0.91765 0.92941 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/base_link.STL" />
</geometry>
</collision>
</link>
<link
name="shoulder_link">
<inertial>
<origin
xyz="-3.8658E-07 -0.0024176 0.13519"
rpy="0 0 0" />
<mass
value="2.1225" />
<inertia
ixx="0.0033227"
ixy="-5.0648E-08"
ixz="-6.3401E-09"
iyy="0.0032419"
iyz="4.3768E-05"
izz="0.0023129" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/shoulder_link.STL" />
</geometry>
<material
name="">
<color
rgba="0.89804 0.91765 0.92941 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/shoulder_link.STL" />
</geometry>
</collision>
</link>
<joint
name="j1"
type="revolute">
<origin
xyz="0 0 0"
rpy="0 0 0" />
<parent
link="base_link" />
<child
link="shoulder_link" />
<axis
xyz="0 0 1" />
<limit
lower="-3.0543"
upper="3.0543"
effort="150"
velocity="3.15" />
<calibration
rising="0"
falling="0" />
<dynamics
damping="0"
friction="0" />
<safety_controller
soft_lower_limit="-3.0543"
soft_upper_limit="3.0543"
k_position="15"
k_velocity="10" />
</joint>
<link
name="upperarm_link">
<inertial>
<origin
xyz="-0.14111 3.4656E-06 0.11053"
rpy="0 0 0" />
<mass
value="4.8053" />
<inertia
ixx="0.0075945"
ixy="3.7143E-07"
ixz="-7.9228E-12"
iyy="0.0081317"
iyz="-1.2918E-11"
izz="0.0059231" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/upperarm_link.STL" />
</geometry>
<material
name="">
<color
rgba="0.89804 0.91765 0.92941 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/upperarm_link.STL" />
</geometry>
</collision>
</link>
<joint
name="j2"
type="revolute">
<origin
xyz="0 0 0.14"
rpy="1.5708 0 0" />
<parent
link="shoulder_link" />
<child
link="upperarm_link" />
<axis
xyz="0 0 1" />
<limit
lower="-4.6251"
upper="1.4835"
effort="150"
velocity="3.15" />
<calibration
rising="0"
falling="0" />
<dynamics
damping="0"
friction="0" />
<safety_controller
soft_lower_limit="-4.6251"
soft_upper_limit="1.4835"
k_position="15"
k_velocity="10" />
</joint>
<link
name="forearm_link">
<inertial>
<origin
xyz="-0.18987 5.2268E-06 0.0034145"
rpy="0 0 0" />
<mass
value="2.2312" />
<inertia
ixx="0.0028852"
ixy="7.3389E-07"
ixz="-3.5373E-05"
iyy="0.0035145"
iyz="-2.8527E-07"
izz="0.0029186" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/forearm_link.STL" />
</geometry>
<material
name="">
<color
rgba="0.89804 0.91765 0.92941 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/forearm_link.STL" />
</geometry>
</collision>
</link>
<joint
name="j3"
type="revolute">
<origin
xyz="-0.28 0 0"
rpy="0 0 0" />
<parent
link="upperarm_link" />
<child
link="forearm_link" />
<axis
xyz="0 0 1" />
<limit
lower="-2.8274"
upper="2.8274"
effort="150"
velocity="3.15" />
<calibration
rising="0"
falling="0" />
<dynamics
damping="0"
friction="0" />
<safety_controller
soft_lower_limit="-2.8274"
soft_upper_limit="2.8274"
k_position="15"
k_velocity="10" />
</joint>
<link
name="wrist1_link">
<inertial>
<origin
xyz="4.5665E-07 -0.0034666 0.098292"
rpy="0 0 0" />
<mass
value="1.5961" />
<inertia
ixx="0.0020112"
ixy="6.8085E-09"
ixz="2.4945E-08"
iyy="0.0014524"
iyz="3.2511E-05"
izz="0.0019076" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/wrist1_link.STL" />
</geometry>
<material
name="">
<color
rgba="0.89804 0.91765 0.92941 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/wrist1_link.STL" />
</geometry>
</collision>
</link>
<joint
name="j4"
type="revolute">
<origin
xyz="-0.24001 0 0"
rpy="0 0 0" />
<parent
link="forearm_link" />
<child
link="wrist1_link" />
<axis
xyz="0 0 1" />
<limit
lower="-4.6251"
upper="1.4835"
effort="28"
velocity="3.2" />
<calibration
rising="0"
falling="0" />
<dynamics
damping="0"
friction="0" />
<safety_controller
soft_lower_limit="-4.6251"
soft_upper_limit="1.4835"
k_position="15"
k_velocity="10" />
</joint>
<link
name="wrist2_link">
<inertial>
<origin
xyz="-4.5262E-07 0.0034666 0.098292"
rpy="0 0 0" />
<mass
value="1.5961" />
<inertia
ixx="0.0020112"
ixy="6.8086E-09"
ixz="-2.4945E-08"
iyy="0.0014524"
iyz="-3.2511E-05"
izz="0.0019076" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/wrist2_link.STL" />
</geometry>
<material
name="">
<color
rgba="0.89804 0.91765 0.92941 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/wrist2_link.STL" />
</geometry>
</collision>
</link>
<joint
name="j5"
type="revolute">
<origin
xyz="0 0 0.102"
rpy="1.5708 0 0" />
<parent
link="wrist1_link" />
<child
link="wrist2_link" />
<axis
xyz="0 0 1" />
<limit
lower="-3.0543"
upper="3.0543"
effort="28"
velocity="3.2" />
<calibration
rising="0"
falling="0" />
<dynamics
damping="0"
friction="0" />
<safety_controller
soft_lower_limit="-3.0543"
soft_upper_limit="3.0543"
k_position="15"
k_velocity="10" />
</joint>
<link
name="wrist3_link">
<inertial>
<origin
xyz="7.559E-05 1.3858E-05 0.076619"
rpy="0 0 0" />
<mass
value="0.53877" />
<inertia
ixx="0.00028785"
ixy="-2.0584E-09"
ixz="-1.3892E-07"
iyy="0.00028896"
iyz="1.8115E-07"
izz="0.00042655" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/wrist3_link.STL" />
</geometry>
<material
name="">
<color
rgba="0.89804 0.91765 0.92941 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://fairino_description/meshes/fairino3_v6/wrist3_link.STL" />
</geometry>
</collision>
</link>
<joint
name="j6"
type="revolute">
<origin
xyz="0 0 0.102"
rpy="-1.5708 0 0" />
<parent
link="wrist2_link" />
<child
link="wrist3_link" />
<axis
xyz="0 0 1" />
<limit
lower="-3.0543"
upper="3.0543"
effort="28"
velocity="3.2" />
<calibration
rising="0"
falling="0" />
<dynamics
damping="0"
friction="0" />
<safety_controller
soft_lower_limit="-3.0543"
soft_upper_limit="3.0543"
k_position="15"
k_velocity="10" />
</joint>
<link name="end_effector" />
<joint name="eef" type="fixed">
<origin
xyz="0 0 0.164"
rpy="0 0 0" />
<parent
link="wrist3_link" />
<child
link="end_effector" />
</joint>
</robot> |
Occasionally, for a reason I can't fathom (some kind of race condition?), the first task does execute, but then the second task fails with the following log:
No name of which failing stage is given, the log just continues. Similar screenshot of rviz GUI: |
Please provide a .zip file comprising a fully self-contained colcon or catkin workspace (you didn't even specify the ROS version you are using). With only a few files provided, one cannot attempt reproducing an issue. |
My apologies, I'm using ROS Jazzy on Ubuntu 24.04 (Noble Numbat). The |
Jumping into the conversation to comment that I recently experienced something similar, also in Jazzy. The task fails without providing any meaningful message about the stage at which it occurs (no stage is marked as failed, and the logging "Failing stage(s):" doesn't specify any message). I haven't had time to investigate deeply, but I was able to replicate the issue by simply changing the I don't think this is related to the former issue, but I hope this helps narrow down the problem when |
@ralphieraccoon: The sources are sufficient. However, please narrow down your workspace to the minimum required to reproduce your issue. Also, I need to know, which launch files to start. @DaniGarciaLopez: Indeed, the |
That's right, I also get the warning. However, when you have a big task with several I just took a look at the code and it should be pretty straightforward to make the changes. I might have time in the following days to prepare a PR if you agree @rhaschke. |
@DaniGarciaLopez, thanks for offering help. I already implemented the change quickly: #651. |
@ralphieraccoon: Looking at #650 (comment), a possible reason for your failure might be incompatible states feeding into both ends of the |
Hi, I've updated the zip file to only include packages needed, same link as before around 110MB. To reproduce the problem run Bear in mind |
Please do so. |
OK, should work without |
Thanks for the tip about the debug. I think there are two issues at play here:
|
The latter issue is related to #650 (comment): The states received from the start and end interface of your |
I think I've fixed the problem, it seems to be an issue with the std::unique_ptr<moveit::task_constructor::stages::FixedState> end_state(
new moveit::task_constructor::stages::FixedState("end state"));
planning_scene::PlanningScenePtr current_plan(
new planning_scene::PlanningScene(task->getRobotModel()));
current_plan->setCurrentState(solution.start_scene.robot_state);
end_state->setState(current_plan); The solution in my case was to add the planning_scene_monitor::LockedPlanningSceneRW ls(servo_planning_scene_monitor_);
planning_scene::PlanningScenePtr current_plan(
new planning_scene::PlanningScene(task->getRobotModel(), ls->getWorldNonConst())); This doesn't feel like the best way to do things for me, perhaps there is a more elegant solution. It would be nice if there was a function to create a |
You could explicitly fetch the current scene using the PlanningSceneInterface (or the corresponding getPlanningScene service). |
I've got a tool swapping function using moveit task constructor:
It works perfectly when I have no collision objects in the planning scene. However, I need the arm to avoid colliding with static objects in the scene when performing the tool change.
But when I add an object into the planning scene using the following in the class constructor:
ComputeIK fails every time, regardless of where the collision object is, even if it's nowhere near the end effector or the arm and no IK plan could possibly collide with it. Here's the relevant logs:
Thanks!
The text was updated successfully, but these errors were encountered: