Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed Nov 16, 2023
1 parent 80460e4 commit 325e51a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
10 changes: 2 additions & 8 deletions rosbot_controller/test/test_xacro.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,16 @@ def test_rosbot_description_parsing():
links = urdf.getElementsByTagName("link")
for link in links:
link_name = link.getAttribute("name")
if namespace != "None":
if namespace != "":
if tf_prefix not in link_name:
assert False, f"Link name '{link_name}' does not contain '{namespace}'"
else:
if tf_prefix in link_name:
assert False, f"Link name '{link_name}' does not contain '{namespace}'"

joints = urdf.getElementsByTagName("joint")
for joint in joints:
joint_name = joint.getAttribute("name")
if namespace != "None":
if namespace != "":
if tf_prefix not in joint_name:
assert False, f"Joint name '{joint_name}' does not contain '{namespace}'"
else:
if tf_prefix in joint_name:
assert False, f"Joint name '{joint_name}' does not contain '{namespace}'"

except xacro.XacroException as e:
assert False, (
Expand Down
4 changes: 2 additions & 2 deletions rosbot_description/urdf/body.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<xacro:macro name="body" params="wheel_radius mecanum use_gpu tf_prefix">
<xacro:include filename="$(find rosbot_description)/urdf/components/vl53lox.urdf.xacro" ns="range_sensor" />

<xacro:property name="prefix" value="$(arg tf_prefix)" lazy_eval="false"/>
<xacro:property name="prefix" value="${tf_prefix}" lazy_eval="false"/>
<xacro:if value="${prefix != ''}">
<xacro:property name="prefix" value="${prefix}_" />
<xacro:property name="prefix" value="${tf_prefix}_" />
</xacro:if>

<link name="${prefix}base_link" />
Expand Down
2 changes: 1 addition & 1 deletion rosbot_description/urdf/rosbot.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<xacro:property name="prefix" value="$(arg tf_prefix)" lazy_eval="false"/>
<xacro:if value="${prefix != ''}">
<xacro:property name="prefix" value="${prefix}_" />
<xacro:property name="prefix" value="$(arg tf_prefix)_" />
</xacro:if>

<!-- Include rosbot_macro.urdf.xacro -->
Expand Down
4 changes: 2 additions & 2 deletions rosbot_description/urdf/rosbot_macro.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<xacro:property name="wheel_radius" value="0.0425" />
</xacro:unless>

<xacro:property name="prefix" value="$(arg tf_prefix)" lazy_eval="false"/>
<xacro:property name="prefix" value="${tf_prefix}" lazy_eval="false"/>
<xacro:if value="${prefix != ''}">
<xacro:property name="prefix" value="${prefix}_" />
<xacro:property name="prefix" value="${tf_prefix}_" />
</xacro:if>

<!-- INCLUDE ROBOT PARTS DEFINITIONS -->
Expand Down

0 comments on commit 325e51a

Please sign in to comment.