Skip to content

Commit

Permalink
Finish cleanup of URDF description files.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisl8 committed Oct 13, 2024
1 parent c8284ba commit d47aa4f
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 114 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ cmake-build-none/
/cypress-tests/package-lock.json
/node/package-lock.json
/website/package-lock.json
arlobot.urdf
8 changes: 8 additions & 0 deletions arlobot_ros/arlobot.urdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- | This document was autogenerated by xacro from /home/chrisl8/ArloBot/urdf/arlo.urdf.xacro | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<robot name="arlobot_hardware">
<!-- Macro for ArloBot body. -->
</robot>
4 changes: 2 additions & 2 deletions setup-jazzy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ printf "\n${YELLOW}[Installing dependencies for ROS build-from-source packages.]
cd "${HOME}/${ROS2_WS}"
rosdep install -q -y -r --from-paths src --ignore-src --rosdistro ${INSTALLING_ROS_DISTRO}

printf "\n${YELLOW}[Generating xacro URDF file.]${NC}\n"
/opt/ros/jazzy/bin/xacro "${HOME}/ArloBot/urdf/common.urdf.xacro" > "${HOME}/ArloBot/arlobot_ros/arlobot.urdf"
printf "\n${YELLOW}[Generating URDF file with xacro.]${NC}\n"
/opt/ros/jazzy/bin/xacro "${HOME}/ArloBot/urdf-xacro-source/common.urdf.xacro" > "${HOME}/ArloBot/arlobot_ros/arlobot.urdf"

printf "\n${YELLOW}[(Re)Building ROS Source files.]${NC}\n"
cd "${HOME}/${ROS2_WS}"
Expand Down
40 changes: 40 additions & 0 deletions urdf-xacro-source/Readme.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ArloBot Description

## Deploy

This is a `urdf` XML file with Macros in it. The macros are expanded by a tool called `xacro`.

You must use the `xacro` command to convert these files int a URDF file before running:
`colcon build`
`xacro common.urdf.xacro > ../arlobot_ros/arlobot.urdf`

The `setup-jazzy.sh` file does this automatically.

## Notes

This folder holds the files that "describe" the physical
characteristics of the Arlobot.

To view the robot model run this from a GUI session:
roslaunch arlobot_ros model_robot.launch
or use the script:
~/dev_ws/src/ArloBot/scripts/model-robot.sh

Start with common.urdf.xacro which is what loads
the other files. It will help you see what each
file does.

There is also an Excel Spreadsheet in the root of this
repository called ArloURDF-Calculations.xlsx that has a lot of
measurements and calculations that I used to build
these files. You can use them to help with adjustments.

---

The robot's physical description is here in the .urdf.xacro files.

While a lot of this can be ignored as cosmetic, two things are important:

1. The physical footprint needs to be right. For arlobot though, that just means having one of the plates on board. As long as nothing sticks out from that plate, you are good.

2. The lidar position on the robot is VERY IMPORTANT
86 changes: 43 additions & 43 deletions urdf/arlo.urdf.xacro → urdf-xacro-source/arlo.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
<!-- base_footprint is a fictitious link(frame) that is on the ground right below base_link origin, navigation stack depends on this frame -->
<link name="base_footprint">
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<box size="0.001 0.001 0.001"/>
</geometry>
<material name="Green"/>
</visual>

<collision>
<origin xyz="0 0 0.017" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 0 0.017"/>
<geometry>
<box size="0.001 0.001 0.001"/>
</geometry>
Expand All @@ -47,15 +47,15 @@
</inertial>

<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<cylinder length="0.0095" radius="0.2245"/>
</geometry>
<material name="veryDarkGrey"/>
</visual>

<collision>
<origin xyz="0 0 0" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<cylinder length="0.0095" radius="0.2245"/>
</geometry>
Expand All @@ -72,23 +72,23 @@
</inertial>

<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<box size="0.1778 0.3366 0.0762"/>
</geometry>
<material name="veryDarkGrey"/>
</visual>

<collision>
<origin xyz="0 0 0" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<box size="0.1778 0.3366 0.0762"/>
</geometry>
</collision>
</link>

<joint name="battery_box_joint" type="fixed">
<origin xyz="0 0 -0.04285" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 0 -0.04285"/>
<parent link="base_link"/>
<child link="battery_box"/>
</joint>
Expand All @@ -103,9 +103,9 @@
</inertial>

<visual>
<origin xyz="0 0 -0.05" rpy="-1.5707 0 0"/>
<origin rpy="-1.5707 0 0" xyz="0 0 -0.05"/>
<geometry>
<cylinder radius="0.03" length="0.03175"/>
<cylinder length="0.03175" radius="0.03"/>
</geometry>
<material name="light_grey">
<color rgba="0.6 0.6 0.6 1"/>
Expand All @@ -115,7 +115,7 @@
</link>

<joint name="front_caster_joint" type="fixed">
<origin xyz="0.18745 0 -0.00475" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0.18745 0 -0.00475"/>
<parent link="base_link"/>
<child link="front_caster"/>
</joint>
Expand All @@ -130,9 +130,9 @@
</inertial>

<visual>
<origin xyz="0 0 -0.05" rpy="-1.5707 0 0"/>
<origin rpy="-1.5707 0 0" xyz="0 0 -0.05"/>
<geometry>
<cylinder radius="0.03" length="0.03175"/>
<cylinder length="0.03175" radius="0.03"/>
</geometry>
<material name="light_grey">
<color rgba="0.6 0.6 0.6 1"/>
Expand All @@ -142,13 +142,13 @@
</link>

<joint name="rear_caster_joint" type="fixed">
<origin xyz="-0.18745 0 -0.00475" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="-0.18745 0 -0.00475"/>
<parent link="base_link"/>
<child link="rear_caster"/>
</joint>

<joint name="base_footprint_joint" type="fixed">
<origin xyz="0 0 0.10125" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 0 0.10125"/>
<parent link="base_footprint"/>
<child link="base_link"/>
</joint>
Expand All @@ -162,23 +162,23 @@
</inertial>

<visual>
<origin xyz="0 0 0" rpy="0 1.5707 1.5707"/>
<origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
<geometry>
<cylinder radius="0.00635" length="0.00635"/>
<cylinder length="0.00635" radius="0.00635"/>
</geometry>
<material name="light_grey"/>
</visual>

<collision>
<origin xyz="0 0 0" rpy="0 1.5707 1.5707"/>
<origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
<geometry>
<cylinder radius="0.00635" length="0.00635"/>
<cylinder length="0.00635" radius="0.00635"/>
</geometry>
</collision>
</link>

<joint name="left_axle_joint" type="fixed">
<origin xyz="0 0.171475 0.0178" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 0.171475 0.0178"/>
<parent link="battery_box"/>
<child link="left_axle_link"/>
<axis xyz="0 1 0"/>
Expand All @@ -193,23 +193,23 @@
</inertial>

<visual>
<origin xyz="0 0 0" rpy="0 1.5707 1.5707"/>
<origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
<geometry>
<cylinder radius="0.00635" length="0.00635"/>
<cylinder length="0.00635" radius="0.00635"/>
</geometry>
<material name="light_grey"/>
</visual>

<collision>
<origin xyz="0 0 0" rpy="0 1.5707 1.5707"/>
<origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
<geometry>
<cylinder radius="0.00635" length="0.00635"/>
<cylinder length="0.00635" radius="0.00635"/>
</geometry>
</collision>
</link>

<joint name="right_axle_joint" type="fixed">
<origin xyz="0 -0.171475 0.0178" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 -0.171475 0.0178"/>
<parent link="battery_box"/>
<child link="right_axle_link"/>
<axis xyz="0 1 0"/>
Expand All @@ -224,25 +224,25 @@
</inertial>

<visual>
<origin xyz="0 0 0" rpy="0 1.5707 1.5707"/>
<origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
<geometry>
<cylinder radius="0.0762" length="0.03175"/>
<cylinder length="0.03175" radius="0.0762"/>
</geometry>
<material name="black"/>
</visual>

<collision>
<origin xyz="0 0 0" rpy="0 1.5707 1.5707"/>
<origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
<geometry>
<cylinder radius="0.0762" length="0.03175"/>
<cylinder length="0.03175" radius="0.0762"/>
</geometry>
</collision>
</link>

<!-- Fixed because we never rotate it anyway, it is just for show -->
<!-- NOTE This may prevent gazebo from working with this model -->
<joint name="left_wheel_joint" type="fixed">
<origin xyz="0 0.01905 0" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 0.01905 0"/>
<parent link="left_axle_link"/>
<child link="left_wheel_link"/>
<axis xyz="0 1 0"/>
Expand All @@ -257,33 +257,33 @@
</inertial>

<visual>
<origin xyz="0 0 0" rpy="0 1.5707 1.5707"/>
<origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
<geometry>
<cylinder radius="0.0762" length="0.03175"/>
<cylinder length="0.03175" radius="0.0762"/>
</geometry>
<material name="black"/>
</visual>

<collision>
<origin xyz="0 0 0" rpy="0 1.5707 1.5707"/>
<origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
<geometry>
<cylinder radius="0.0762" length="0.03175"/>
<cylinder length="0.03175" radius="0.0762"/>
</geometry>
</collision>
</link>

<!-- Fixed because we never rotate it anyway, it is just for show -->
<!-- NOTE This may prevent gazebo from working with this model -->
<joint name="right_wheel_joint" type="fixed">
<origin xyz="0 -0.01905 0" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 -0.01905 0"/>
<parent link="right_axle_link"/>
<child link="right_wheel_link"/>
<axis xyz="0 1 0"/>
</joint>

<!-- This pretends to be in the center in order to aid in calculating degrees from multiple sensors on one fake laser scan -->
<joint name="ping_array_joint" type="fixed">
<origin xyz="0 0 0.03695" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 0 0.03695"/>
<parent link="base_link"/>
<child link="ping_sensor_array"/>
</joint>
Expand All @@ -304,7 +304,7 @@
</link>

<joint name="ir_array_joint" type="fixed">
<origin xyz="0 0 0.03695" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 0 0.03695"/>
<parent link="base_link"/>
<child link="ir_sensor_array"/>
</joint>
Expand All @@ -328,7 +328,7 @@
<joint name="scanse_sweep_joint" type="fixed">
<!-- Minor adjustments based on lining up Scanse Sweep output with 3D Sensor output -->
<!-- So if the 3D sensor is misaligned the Scanse Sweep is off by the same amount -->
<origin xyz="0.15 0.0 0.269107" rpy="0 0 3.13"/>
<origin rpy="0 0 3.13" xyz="0.15 0.0 0.269107"/>
<parent link="base_link"/>
<child link="scanse_sweep"/>
</joint>
Expand Down Expand Up @@ -358,7 +358,7 @@
<!-- NOTE: The "FRONT" of the RPLIDAR A2/3 is the point where the cord comes out. -->
<!-- Hence the r of 3.1 to rotate it half way around. -->
<!-- The height is set even with the top plate. It shouldn't matter really. -->
<origin xyz="0.125 0.0 0.269107" rpy="0.0 0.0 0.0"/>
<origin rpy="0.0 0.0 0.0" xyz="0.125 0.0 0.269107"/>
<parent link="base_link"/>
<child link="rplidar"/>
</joint>
Expand Down Expand Up @@ -397,7 +397,7 @@
</inertial>

<visual>
<origin xyz=" 0 0 0 " rpy="0 0 0"/>
<origin rpy="0 0 0" xyz=" 0 0 0 "/>
<geometry>
<cylinder length="0.127" radius="0.00635"/>
</geometry>
Expand All @@ -407,7 +407,7 @@
</visual>

<collision>
<origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0.0 0.0 0.0"/>
<geometry>
<cylinder length="0.127" radius="0.00635"/>
</geometry>
Expand Down Expand Up @@ -459,7 +459,7 @@
z_loc="0.06825"/>

<joint name="plate_1_joint" type="fixed">
<origin xyz="0 0 0.1365" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0 0 0.1365"/>
<parent link="plate_0_link"/>
<child link="plate_1_link"/>
</joint>
Expand All @@ -474,7 +474,7 @@
</inertial>

<visual>
<origin xyz=" 0 0 0 " rpy="0 0 0"/>
<origin rpy="0 0 0" xyz=" 0 0 0 "/>
<geometry>
<cylinder length="0.0095" radius="0.2245"/>
</geometry>
Expand All @@ -484,7 +484,7 @@
</visual>

<collision>
<origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
<origin rpy="0 0 0" xyz="0.0 0.0 0.0"/>
<geometry>
<cylinder length="0.0095" radius="0.2245"/>
</geometry>
Expand Down
File renamed without changes.
Loading

0 comments on commit d47aa4f

Please sign in to comment.