This would be no different from mounting your robot model as you would do it normally "on the floor".
Create a new .xacro
file, import the robot macro .xacro
as you'd normally do.
Then create the fixed
joint that you'd normally create to place the robot in your scene, but instead of using an identity transform (ie: xyz="0 0 0" rpy="0 0 0"
) specify a Z-offset (to translate it "into the air"), then rotate it over either the Y or the X axis by 180 degrees and make the robot's base_link
the child
frame.
Example:
<?xml version="1.0" ?>
<robot name="upside_down_m10ia" xmlns:xacro="http://wiki.ros.org/xacro">
<xacro:include filename="$(find fanuc_m10ia_support)/urdf/m10ia_macro.xacro"/>
<xacro:fanuc_m10ia prefix="robot_"/>
<link name="world" />
<joint name="ceiling_joint" type="fixed">
<origin xyz="0 0 2" rpy="0 ${radians(180)} 0" />
<parent link="world" />
<child link="robot_base_link" />
</joint>
</robot>
In RViz, this would look like this (after setting the Fixed Frame
setting to world
):
Note how world
has positive X pointing "away" from the robot. That is because I rotated 180 degrees over Y. If you don't like that, you could add an additional intermediate frame or an add an additional rotation.
Any info on best practices for this, or how to get the robot to appear upside down, with its mount somewhere other than the origin of the world frame would be helpful,
Note btw that if you've been using the provided top-level .xacro
files in the Fanuc support packages then those robots are not "mounted", but the kinematic chain just starts at the base_link
of the robot. And as there is nothing else, that automatically becomes the root of your world.
Edit: you might want to add an additional tool frame that is rotated such that Z+ is again "up", instead of down (as it would be because of the ceiling mount).
It's not required, but might be nice.