-
Notifications
You must be signed in to change notification settings - Fork 6
Setup the fanuc_sim config with a basic tool-changing example #31
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| <!-- UR5e inspired from https://github.com/google-deepmind/mujoco_menagerie/tree/main/universal_robots_ur5e --> | ||
| <mujoco model="fanuc scene"> | ||
| <compiler angle="radian" autolimits="true" /> | ||
| <option integrator="RK4" timestep="0.005" /> | ||
| <option integrator="implicit" /> | ||
| <include file="lrmate200id/lrmate200id_globals.xml" /> | ||
| <include file="tool.xml" /> | ||
|
|
||
| <asset> | ||
| <!-- Define textures and materials --> | ||
|
|
@@ -82,6 +83,7 @@ | |
| <!-- Define the block with AprilTags on each face --> | ||
| <body name="block1" pos="0.2 0.75 0.575"> | ||
| <freejoint name="block1" /> | ||
| <site name="block1" pos="0 0 0" /> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are these sites necessary for the weld constraint to activate?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
| <geom | ||
| type="box" | ||
| size="0.025 0.025 0.025" | ||
|
|
@@ -91,11 +93,13 @@ | |
| </body> | ||
| <body name="block2" pos="0.0 0.75 0.575"> | ||
| <freejoint name="block2" /> | ||
| <site name="block2" pos="0 0 0" /> | ||
| <geom class="visual" mesh="cube" pos="0 0 -0.03" /> | ||
| <geom class="collision" type="box" size="0.025 0.025 0.025" pos="0 0 0" /> | ||
| </body> | ||
| <body name="block3" pos="-0.2 0.75 0.575"> | ||
| <freejoint name="block3" /> | ||
| <site name="block3" pos="0 0 0" /> | ||
| <geom | ||
| type="box" | ||
| size="0.025 0.025 0.025" | ||
|
|
@@ -106,19 +110,58 @@ | |
| <!-- Add a scene camera --> | ||
| <site | ||
| name="scene_camera_optical_frame" | ||
| pos="0.0 1.6 1.6" | ||
| euler="2.2415 0 3.1415" | ||
| pos="1.1 1.1 1.5" | ||
| euler="2.6 -0.8 -2.14" | ||
| /> | ||
| <camera | ||
| name="scene_camera" | ||
| pos="0.0 1.6 1.6" | ||
| pos="1.1 1.1 1.5" | ||
| fovy="58" | ||
| mode="fixed" | ||
| resolution="640 480" | ||
| euler="-0.9 0 3.1415" | ||
| euler="-0.54 0.8 2.14" | ||
| /> | ||
| <body name="arm_mount"> | ||
| <body name="arm_pedestal" pos="0.0 0.3 0.15"> | ||
| <geom type="box" size="0.2 0.2 0.15" /> | ||
| <geom type="box" size="0.06 0.01 0.01" pos="0.23 0.03 0.1" /> | ||
| <geom type="box" size="0.06 0.01 0.01" pos="0.23 -0.03 0.1" /> | ||
| <site name="tool_holder_site" pos="0.25 0 0.15" euler="3.1415 0 0" /> | ||
| </body> | ||
| <body name="arm_mount" pos="0.0 0.3 0.3"> | ||
| <include file="lrmate200id/lrmate200id.xml" /> | ||
| </body> | ||
| </worldbody> | ||
|
|
||
| <!-- Define weld constraints between the robot flange (tool0) and the gripper, and between the suction cup (tool_tip) | ||
| and the blocks in the scene --> | ||
| <equality> | ||
| <weld | ||
| name="tool_attachment" | ||
| body1="tool0" | ||
| body2="gripper_base" | ||
| active="false" | ||
| torquescale="1" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this needs to be increased. The attached tool is sort of "floppy" right now.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer an issue! |
||
| /> | ||
| <weld | ||
| name="suction_cup_block1" | ||
| body1="tool_tip" | ||
| body2="block1" | ||
| active="false" | ||
| torquescale="1" | ||
| /> | ||
| <weld | ||
| name="suction_cup_block2" | ||
| body1="tool_tip" | ||
| body2="block2" | ||
| active="false" | ||
| torquescale="1" | ||
| /> | ||
| <weld | ||
| name="suction_cup_block3" | ||
| body1="tool_tip" | ||
| body2="block3" | ||
| active="false" | ||
| torquescale="1" | ||
| /> | ||
| </equality> | ||
| </mujoco> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| <?xml version="1.0" ?> | ||
| <robot name="fanuc_tool" xmlns:xacro="http://wiki.ros.org/xacro"> | ||
| <link name="gripper_base"> | ||
| <visual> | ||
| <origin rpy="0 0 0" xyz="0 0 0.02" /> | ||
| <geometry> | ||
| <box size="0.06 0.06 0.04"/> | ||
| </geometry> | ||
| <material name="darkgrey"> | ||
| <color rgba="0.1 0.1 0.1 1"/> | ||
| </material> | ||
| </visual> | ||
| <collision> | ||
| <origin rpy="0 0 0" xyz="0 0 0.02" /> | ||
| <geometry> | ||
| <box size="0.06 0.06 0.04"/> | ||
| </geometry> | ||
| <material name="darkgrey"/> | ||
| </collision> | ||
| </link> | ||
| <link name="suction_cylinder"> | ||
| <visual> | ||
| <origin rpy="0 0 0" xyz="0 0 0.03" /> | ||
| <geometry> | ||
| <box size="0.01 0.01 0.06"/> | ||
| </geometry> | ||
| <material name="darkgrey"/> | ||
| </visual> | ||
| <collision> | ||
| <origin rpy="0 0 0" xyz="0 0 0.03" /> | ||
| <geometry> | ||
| <box size="0.01 0.01 0.06"/> | ||
| </geometry> | ||
| <material name="darkgrey"/> | ||
| </collision> | ||
| </link> | ||
| <joint name="base_joint" type="fixed"> | ||
| <parent link="gripper_base" /> | ||
| <child link="suction_cylinder" /> | ||
| <origin rpy="0 0 0" xyz="0 0 0.04" /> | ||
| </joint> | ||
| </robot> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <mujoco model="fanuc_tool"> | ||
| <compiler angle="radian" autolimits="true" /> | ||
| <option integrator="RK4" timestep="0.005" /> | ||
|
|
||
| <worldbody> | ||
| <body | ||
| name="gripper_base" | ||
| gravcomp="1" | ||
| pos="0.25 0.3 0.3" | ||
| euler="3.1415 0 0" | ||
| > | ||
| <joint | ||
| type="free" | ||
| stiffness="0" | ||
| damping="0" | ||
| frictionloss=".001" | ||
| armature="0" | ||
| /> | ||
| <site name="tool_attach_site" pos="0 0 0" euler="0 0 0" /> | ||
|
|
||
| <geom type="cylinder" size="0.03 0.02" pos="0 0 0.02" rgba=".1 .1 .1 1" /> | ||
| <body name="suction_cylinder" gravcomp="1" pos="0 0 0.04"> | ||
| <geom | ||
| type="cylinder" | ||
| size="0.01 0.03" | ||
| pos="0 0 0.03" | ||
| margin="0.01" | ||
| gap="0.01" | ||
| rgba=".1 .1 .1 1" | ||
| /> | ||
| <body name="tool_tip" gravcomp="1" pos="0 0 0.055"> | ||
| <geom | ||
| class="collision" | ||
| type="cylinder" | ||
| size="0.01 0.005" | ||
| margin="0.01" | ||
| gap="0.01" | ||
| /> | ||
| <site name="suction_cup_tool_tip" /> | ||
| </body> | ||
| </body> | ||
| </body> | ||
| </worldbody> | ||
| </mujoco> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <root BTCPP_format="4" main_tree_to_execute="Activate Vacuum"> | ||
| <BehaviorTree | ||
| ID="Activate Vacuum" | ||
| _description="Activate the vacuum gripper" | ||
| _subtreeOnly="false" | ||
| > | ||
| <Control ID="Sequence" name="root"> | ||
| <Action | ||
| ID="MoveGripperAction" | ||
| position="1" | ||
| gripper_command_action_name="/suction_cup_controller/gripper_cmd" | ||
| /> | ||
| </Control> | ||
| </BehaviorTree> | ||
| <TreeNodesModel> | ||
| <SubTree ID="Activate Vacuum" /> | ||
| </TreeNodesModel> | ||
| </root> |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <root BTCPP_format="4" main_tree_to_execute="Deactivate Vacuum"> | ||
| <!--//////////--> | ||
| <BehaviorTree | ||
| ID="Deactivate Vacuum" | ||
| _description="Deactivate the vacuum gripper" | ||
| _subtreeOnly="false" | ||
| > | ||
| <Control ID="Sequence" name="root"> | ||
| <Action | ||
| ID="MoveGripperAction" | ||
| position="0" | ||
| gripper_command_action_name="/suction_cup_controller/gripper_cmd" | ||
| /> | ||
| </Control> | ||
| </BehaviorTree> | ||
| <TreeNodesModel> | ||
| <SubTree ID="Deactivate Vacuum" /> | ||
| </TreeNodesModel> | ||
| </root> |
This file was deleted.
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.
lrmate200id_globals.xmlneeds some KP and other tuning. I'll pull some in from https://github.com/PickNikRobotics/picknik_accessories/tree/pr-fanuc-workshop-assetsRight now it is overshooting and hitting the tool during docking very aggressively.
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.
Updated the gains in this PR.
Not super perfect but should behave much better. I'm able to run the same objective over and over again.
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.
It is way better! I can run it successfully reliably as well.