Unable to move center of mass for child link
Ubuntu 16.04, Kinetic, Gazebo 7.16.0-1 Xenial
Hello
I am attempting to connect two links together via a revolute joint. Currently the center of mass for the child link is at the revolute joint connecting the two. I am able to modify the visual and collision location of the child link, but the center of mass does not move. I have followed a few tutorials and searched through prior questions, it seems like changing the inertia origin should fix the issue, but it seems to make no difference.
The visual is correct, there is one box, then a gap, then another box.
<?xml version='1.0'?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="train3">
<xacro:property name="body_length" value="2.5" />
<xacro:property name="axel_offset" value="0.5" />
<xacro:property name="axel_z_offset" value="-0.25" />
<xacro:macro name="body_macro" params="xyz name">
<link name="${name}">
<inertial>
<origin rpy="0 0 0" xyz="${xyz}"/>
<mass value="55"/>
<inertia ixx="0.166667" ixy="0" ixz="0" iyy="0.166667" iyz="0" izz="0.166667"/>
</inertial>
<collision name="collision">
<origin rpy="0 0 0" xyz="${xyz}"/>
<geometry>
<box size="2 0.5 0.5" />
</geometry>
</collision>
<visual name="visual">
<origin rpy="0 0 0" xyz="${xyz}"/>
<geometry>
<box size="2 0.5 0.5" />
</geometry>
<material name="silver">
<color rgba="0.75 0.75 0.75 1"/>
</material>
</visual>
</link>
</xacro:macro>
<xacro:macro name="body_joint_macro" params="xyz name parent child">
<joint name="${name}" type="revolute">
<parent link="${parent}"/>
<child link="${child}"/>
<origin rpy="0 0 0" xyz="${xyz}"/>
<axis xyz="0 0 1"/>
<limit effort="-1" lower="-1.57" upper="1.57" velocity="-1"/>
</joint>
</xacro:macro>
<!-- body one -->
<xacro:body_macro name="body_1" xyz="0 0 0"/>
<!-- body two -->
<xacro:body_macro name="body_2" xyz="${-body_length/2} 0 0"/>
<xacro:body_joint_macro name="body_joint_1" parent="body_1" child="body_2" xyz="${-body_length/2} 0 0"/>
</robot>