Skip to content

About

Independently created display models of robot components (wheels, casters, lidars, single-board computers, microcontrollers) with their CadQuery generators, for ROS 1 and ROS 2

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

robot_component_models

Display models of off-the-shelf robot components, such as a laser scanner, single-board computers and a caster, for ROS 1 (Noetic) and ROS 2 (Humble and later), made for the DiffBot and Remo robots. Every model is generated by a script with CadQuery, a Python library for solid models, from the dimensions in datasheets, drawings and photos. This repository contains the generators. Each part's provenance page lists the sources of its dimensions and appearance.

All parts at their real size

These are display models for visualisation in RViz, Gazebo and web viewers. They aren't manufacturing designs. Robot assembly, joints, collision shapes and inertias belong in each robot's description package.

Parts

Part Picture Meshes Used by Triangles STL / DAE / GLB
Swivel caster with a 30 mm wheel Swivel caster swivel_caster_30mm/swivel_caster_30mm_base
swivel_caster_30mm/swivel_caster_30mm_wheel_support
swivel_caster_30mm/swivel_caster_30mm_wheel
DiffBot 32,234
12,592
5,572
1,612 / 2,097 / 656 kB
630 / 846 / 280 kB
279 / 352 / 121 kB
360 degree laser scanner, RPLIDAR A2 size Laser scanner rplidar_a2/rplidar_a2 DiffBot, Remo 13,014 651 / 904 / 332 kB
360 degree laser scanner, RPLIDAR A1 size Laser scanner, RPLIDAR A1 size rplidar_a1/rplidar_a1 Remo, with remo_description#26 26,826 1,341 / 1,818 / 670 kB
Raspberry Pi 4 Model B Raspberry Pi 4 Model B raspberry_pi_4b/raspberry_pi_4b Remo 36,948 1,847 / 3,054 / 1,485 kB
Jetson Nano Developer Kit B01 Jetson Nano Developer Kit jetson_nano_dev_kit_b01/jetson_nano_dev_kit_b01 Remo 37,344 1,867 / 2,982 / 1,400 kB
Teensy 4.0 with two 14-pin headers Teensy 4.0 teensy_4_0/teensy_4_0 Remo 25,520 1,276 / 2,021 / 900 kB
400-point solderless breadboard Breadboard breadboard_400_point/breadboard_400_point Remo 6,768 338 / 526 / 290 kB
Raspberry Pi Camera Module v2 Camera Module v2 raspberry_pi_camera_v2/raspberry_pi_camera_v2 Remo 2,976 149 / 246 / 116 kB
Wheel 65 mm for TT gear motors Wheel tt_motor_wheel_65mm/tt_motor_wheel_65mm DiffBot, Remo 97,550 4,878 / 7,019 / 2,194 kB
Gear motor with hall encoder, DG01D-E size Gear motor dg01d_e_gearmotor/dg01d_e_gearmotor Not yet (the motor of DiffBot and Remo) 15,596 780 / 1,060 / 400 kB

Each mesh comes in three files in meshes/<part>/, all in metres:

  • <name>.dae: COLLADA 1.4.1, Z up, with coloured materials and one node per sub-part.
  • <name>.stl: binary STL, without colours.
  • <name>.glb: binary glTF 2.0 with the same materials, for web viewers. The COLLADA colours are sRGB values, as viewers show them, and the glTF base colours are the same colours as linear values, as glTF defines them. Metal parts are metallic, and the roughness follows from the COLLADA shininess. Each sub-part, such as a connector, is a named node, so a viewer can move the sub-parts apart.

meshes/manifest.yaml lists every file with its checksum, size, units, frame, bounding box, triangle count, sub-parts and materials. The provenance page of each part, linked in the table, lists its sources, shows its frame in a picture, and says what was estimated or simplified and which measurements would improve it.

Adding the package to a workspace

The package installs data and its documentation: meshes/ with the manifest, provenance/ with each part's page, LICENSE, and what the pages link to, which are the generators' Python files in generators/ and the frame pictures in docs/images/frames/. So every link of an installed page that points into the repository leads to an installed file. The generators are installed to be read. The package builds with catkin under ROS 1 and with ament_cmake under ROS 2, and CadQuery isn't needed to build or use it.

  1. Declare the dependency in the package.xml of the package that uses the meshes:

    <exec_depend>robot_component_models</exec_depend>
  2. Add the repository to the workspace. For example, with vcstool, add this to the workspace's .repos file:

    repositories:
      robot_component_models:
        type: git
        url: https://github.com/ros-mobile-robots/robot_component_models.git
        version: 1.0.0

    Releases are tagged with their version, such as 1.0.0. Pin a release's tag as the version, as in the example: a released file keeps its frame (see Versioning).

  3. Import, build and source the workspace. In ROS 1 Noetic:

    cd ~/catkin_ws && vcs import src < my_robot.repos
    catkin build robot_component_models
    source devel/setup.bash

    In ROS 2:

    cd ~/ros2_ws && vcs import src < my_robot.repos
    colcon build --packages-up-to robot_component_models
    source install/setup.bash
  4. Check that ROS finds the package and that the laser scanner's COLLADA file is there. In ROS 1:

    ls "$(rospack find robot_component_models)/meshes/rplidar_a2/rplidar_a2.dae"

    In ROS 2:

    ls "$(ros2 pkg prefix --share robot_component_models)/meshes/rplidar_a2/rplidar_a2.dae"

    Each command prints the file's path. The next section shows this file in a URDF.

vcs import --skip-existing doesn't move an existing checkout to a new tag. To update one, run git fetch --tags && git checkout <tag> in src/robot_component_models.

Using the meshes in a URDF

A URDF refers to a file as package://robot_component_models/meshes/<part>/<file>. Each mesh has its own frame. Its origin and axes are in the manifest and in the Frame section of its provenance page, which starts with a picture of the frame. The robot description supplies the transform that places the mesh.

Choosing the file

File Use In the URDF
<name>.dae, COLLADA Coloured visuals, in ROS 1 and in ROS 2. The file brings its own colours. Leave out the scale. Leave out material overrides, the visual's <material> and the link's Gazebo <material>, to keep the mesh's colours across viewers.
<name>.stl A visual in one colour. Leave out the scale: the file is in metres. RViz takes the colour from the visual's <material>, Gazebo Classic from the link's Gazebo <material>.
<name>.glb, binary glTF Web viewers. glTF defines y as up, and the file's root node turns the mesh into that scene. Use the COLLADA file in a URDF. RViz 2 and Gazebo (gz-sim) in ROS 2 Jazzy show a part from its glTF file turned by 90° about x against its COLLADA file, and gz-sim drew the metal materials dark in the one scene that was tried (issue #14). RViz in ROS 1, Gazebo Classic and Gazebo Fortress don't load .glb files.

Placing a mesh

The visual's <origin> places the mesh's frame in the link's frame. The laser scanner's frame has its origin on the rotation axis, in the laser band, 29.85 mm above the scanner's bottom (see its Frame section).

A link whose frame is the mesh's frame shows the mesh without an offset:

<link name="scanner_link">
  <visual>
    <geometry>
      <mesh filename="package://robot_component_models/meshes/rplidar_a2/rplidar_a2.dae"/>
    </geometry>
  </visual>
</link>

A link whose origin lies at the scanner's bottom, with the same axes, raises the mesh by 29.85 mm. The scanner's bottom then sits at the link's origin:

<link name="scanner_mount">
  <visual>
    <origin xyz="0 0 0.02985" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://robot_component_models/meshes/rplidar_a2/rplidar_a2.dae"/>
    </geometry>
  </visual>
</link>

The STL file takes its colour from the URDF. RViz reads the visual's <material>. The visual defines the colour itself, so the example needs no material elsewhere in the robot description:

<link name="scanner_mount">
  <visual>
    <origin xyz="0 0 0.02985" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://robot_component_models/meshes/rplidar_a2/rplidar_a2.stl"/>
    </geometry>
    <material name="dark_grey">
      <color rgba="0.2 0.2 0.2 1"/>
    </material>
  </visual>
</link>

Gazebo Classic doesn't take a colour from the visual's <material>: converted for Gazebo Classic 11, the example's visual has no material. Gazebo Classic takes the colour of a link from a <gazebo> element that names the link and one of Gazebo's materials:

<gazebo reference="scanner_mount">
  <material>Gazebo/DarkGrey</material>
</gazebo>

A visual's rpy turns the mesh. DiffBot's and Remo's laser links have the scanner's cable at their +x, where the mesh has it at -x, so their visuals turn the mesh by π about z (see the Frame section).

A part with several meshes has one link for each mesh. The caster's Frames section gives the offsets between its three meshes: swivel_caster_30mm_base, swivel_caster_30mm_wheel_support and swivel_caster_30mm_wheel.

Keep the collision shapes and inertias in the robot description, for example as boxes and cylinders.

Gazebo (gz-sim): the resource path

RViz, RViz 2 and Gazebo Classic find package://robot_component_models/... through ROS. The newer Gazebo, gz-sim, looks for a folder named robot_component_models in the folders of its resource path. The package doesn't add itself to that path yet (issue #13). Until it does, add the folder that holds the installed package before Gazebo starts:

export GZ_SIM_RESOURCE_PATH="$(dirname "$(ros2 pkg prefix --share robot_component_models)")${GZ_SIM_RESOURCE_PATH:+:$GZ_SIM_RESOURCE_PATH}"

Without the path, gz-sim spawns the robot, logs Unable to find file with URI [model://robot_component_models/...] and draws no mesh. This was seen with ROS 2 Jazzy and Gazebo Harmonic (gz-sim 8.15.0), with a test package that is installed like this one. Gazebo Fortress, the Gazebo of ROS 2 Humble, names the variable IGN_GAZEBO_RESOURCE_PATH.

Tested so far

  • ROS 1 Noetic, RViz 1.14 and Gazebo Classic 11: the COLLADA and STL files in DiffBot's and Remo's descriptions. The robots' drive wheels there are their own meshes, so the 65 mm wheel's files haven't been drawn in these scenes yet. The gear motor's COLLADA and STL files were drawn on the motor links of test copies of both descriptions.
  • ROS 2 Humble, RViz 2 and Gazebo Fortress: CI checks the package's build and install. Both viewers drew the camera and the Teensy from their COLLADA files. Their mesh loaders read nine COLLADA files with every corner at the file's position, and the nine STL files of that test with the triangle counts and bounding boxes that the manifest gave for those files. These nine meshes are those of the parts other than the 65 mm wheel, the A1 and the gear motor. The laser scanner of the A2's size, the Teensy, the breadboard and the camera were tested with the COLLADA files of this version. The caster's three meshes and the two boards were tested in an earlier version, with other materials, and the caster's base and wheel support and the two boards also with other shapes.
  • ROS 2 Jazzy, RViz 2 and gz-sim 8:
    • Drawn from the COLLADA files: the same nine meshes, each on its own and all nine in one scene.
    • Drawn from an STL file: the camera. The other STL files haven't been drawn there in a test yet.
    • Read by the viewers' mesh loaders: the same nine COLLADA files, and the COLLADA files of this version of the A1 and of the caster's base and wheel support, each with every corner at the file's position. Also the nine STL files of that test, with the triangle counts and bounding boxes that the manifest gave for those files.
    • The glTF files: an earlier version of the same nine meshes' glTF files, drawn with sRGB values as base colours. The 90° turn and the dark metals in the table above come from that test. VTK's glTF importer drew a few examples with linear base colours. RViz 2 and gz-sim haven't drawn the glTF files with linear base colours in a test yet.
    • The 65 mm wheel's, the A1's and the gear motor's files haven't been drawn there in a test yet.

The robots' descriptions are ROS 1 packages, so test models with these meshes stand in for them in the ROS 2 tests.

In close-ups, Gazebo Classic draws some small features of the COLLADA files deformed. Millimetre COLLADA files for close-ups in Gazebo Classic has the cause, the numbers and the files that Gazebo Classic draws correctly.

Mesh conventions

Units

All files are in metres, ROS's unit for lengths (REP 103). STL has no unit field, and ROS reads its coordinates as metres, so no file needs a scale. The generators build the models in millimetres and convert the coordinates when they write the files. The provenance pages give positions in millimetres.

For close-ups in Gazebo Classic, the generators can write the COLLADA files in millimetres into a separate folder. See Millimetre COLLADA files for close-ups in Gazebo Classic.

Frames

Each mesh has its own local frame, Z up. The origin isn't always the part's centre, and the axes follow each part. For example:

Every mesh's frame is described in the manifest (frame) and in the Frame section of its provenance page. That section starts with a picture of the frame: the origin, the positive axes, a ring around each mounting hole and a line at the mounting plane. The manifest's bounding boxes are in this local frame.

The glTF files use the same local frame for their vertex data. Their root node turns the data by -90° about x into glTF's Y-up scene. The manifest's glTF bounding boxes are those of the vertex data, before this root rotation.

File names

Names are lowercase snake_case and name the product. A part's folder, generator module, provenance page and picture share one identifier, for example rplidar_a2. A part with one mesh uses that identifier as the file stem: meshes/rplidar_a2/rplidar_a2.stl. A part with several meshes adds each mesh's role: swivel_caster_30mm_base, swivel_caster_30mm_wheel_support and swivel_caster_30mm_wheel. A further design of the same kind gets its own qualifier, for example a different caster.

Versioning

A released file keeps its frame, units and attachment points. A change that moves the origin, turns the axes, changes the units or moves an attachment point, such as mounting holes or an axle, gets a new file name. The old file stays, so robots that use it don't change. A change that keeps all of these keeps the file name, even if the bounding box grows with a finer detail. The manifest then shows the new checksum and bounding box.

The version follows Semantic Versioning: the first number rises when a file is removed or renamed, the second when files are added or changed, the third for fixes that leave the meshes as they are.

Regenerating the meshes

The generators are Python scripts, one per part, in generators/. They use CadQuery and its OCP bindings to OpenCASCADE. Each has its parameters at the top, with the source of each value. generators/mesh_export.py writes the three file formats for all of them. CadQuery is needed only to regenerate the files, not to build or use the package. generators/board_parts.py holds what the two single-board computers share: connectors, pin headers, small parts and their materials.

CI regenerates the files byte for byte in its generator environment: the Ubuntu 24.04 image, pinned by its digest, with Python 3.12.3 and glibc 2.39, and the Python packages of generators/requirements.txt, pinned to exact versions. The Ubuntu packages that CI installs with apt aren't pinned. Other versions of CadQuery, OCP or NumPy, or another operating system, can triangulate differently. The meshes are then still valid, but their checksums change.

So check the released files, and write them, in that environment. The generator environment in a container in the contributor guide builds it once and then runs the check, which only reads meshes/.

For the work on a model, a virtual environment on the host is quicker. From the repository's root:

python3 -m venv .venv && .venv/bin/pip install -r generators/requirements.txt
.venv/bin/python -m generators --check          # regenerate into a temporary folder, compare with meshes/
.venv/bin/python -m generators rplidar_a2       # write one part's meshes
.venv/bin/python -m generators                  # write all meshes and meshes/manifest.yaml
.venv/bin/python scripts/check_meshes.py        # read the files back, check them against the manifest
.venv/bin/python -m unittest discover -s tests  # the unit tests of the generators and the checks
.venv/bin/python scripts/render_parts.py        # render the pictures in docs/images/
.venv/bin/python -m scripts.render_frames       # render the frame pictures in docs/images/frames/

--check only reads meshes/. With --check --keep DIR, the regenerated files stay in the new folder DIR, outside meshes/, for a closer look.

The models are written with CadQuery because its models are plain Python driven by the dimensions from the sources, built on the OpenCASCADE solid modelling kernel. A change to a model is a readable diff of parameters and code, the generators need no graphical CAD program, and CI regenerates and checks every file. build123d is the closest alternative, also a Python library on OpenCASCADE.

Millimetre COLLADA files for close-ups in Gazebo Classic

A mounting hole of the camera as Gazebo Classic reads it: deformed from the released file in metres, round from the millimetre file

The picture shows one of the camera's Ø2.2 mm mounting holes with its gold ring, as Gazebo Classic 11's COLLADA loader reads it from the released file in metres and from the millimetre file.

The released files in meshes/ are in metres. For close-up pictures in Gazebo Classic, the generators write the COLLADA files once more, in millimetres, into a new folder that you name:

.venv/bin/python -m generators --millimetre-collada build/meshes_mm

This creates the folder build/meshes_mm and writes build/meshes_mm/<part>/<name>.dae for every mesh, and no other file. With part names before the option, it writes only those parts' files. The option writes only into a folder that it creates itself: it refuses a folder that exists already, and a folder inside meshes/. So the option never changes an existing file, and a released file never changes its unit under its name. To write the files again, remove the folder first or name another one.

scripts/check_millimetre_collada.py compares such a folder with the released files. Without --parts it expects every part's files. After a run for some parts, name the same parts:

.venv/bin/python scripts/check_millimetre_collada.py build/meshes_mm
.venv/bin/python -m generators raspberry_pi_camera_v2 --millimetre-collada build/camera_mm
.venv/bin/python scripts/check_millimetre_collada.py build/camera_mm --parts raspberry_pi_camera_v2

What a millimetre file is. A COLLADA file names its unit of length in its <unit> element. A millimetre file declares <unit name="millimeter" meter="0.001"/>, and each of its positions is 1000 times the released file's. The normals, triangles, materials and sub-parts are the same. A program that applies the unit loads the same mesh from both files, at the same size and place. So a millimetre file needs no scale in the URDF either. scale="0.001 0.001 0.001" would apply the unit a second time.

When the millimetre files help. Gazebo Classic's COLLADA loader can treat two positions as one vertex when they lie within 0.001 of each other on every axis, counted in the file's unit. The loader applies the unit afterwards. In a file in metres that distance is 1 mm. Gazebo Classic 11.15.1 then draws some triangle corners at a neighbouring vertex's position, and some triangles collapse into a line. In the Raspberry Pi camera's released file, 473 of 8,928 corners are drawn up to 1.6 mm from their place, and 61 of 2,976 triangles collapse. In the Teensy's file these are 3,813 of 76,560 corners and 274 of 25,520 triangles. Close up, some small features look deformed, for example the camera's mounting holes and the Teensy's push button. At whole-robot distance the effect is hardly visible. In a millimetre file that distance is 1 µm, and Gazebo Classic draws every corner at its place, measured for the nine millimetre meshes at 8a41fb9: the caster's three, the laser scanner of the A2's size, the two boards, the Teensy, the breadboard and the camera. The other millimetre files, such as the 65 mm wheel's, are checked against their files in metres by the checker below, not yet in a viewer.

Where they change nothing. RViz 1, RViz 2, Gazebo Fortress and Gazebo Harmonic draw the released files correctly. Their mesh loaders give the same mesh for both files, within 0.00001 mm, measured for the same nine meshes.

What ignores the unit. A program that ignores the <unit> element reads a millimetre file 1000 times too large. One such program is geometric_shapes, which MoveIt uses to load collision meshes (measured with version 2.3.4 on ROS 2 Jazzy). Use the released files in such a program.

How a robot description uses them. The millimetre files aren't part of the installed package. So the folder has to be in a ROS package on the machine that runs the viewer. For example, write the files into a description package of your own, as my_robot_description/meshes_mm, let that package install the folder, and refer to a file by that package's name:

<visual>
  <geometry>
    <mesh filename="package://my_robot_description/meshes_mm/raspberry_pi_camera_v2/raspberry_pi_camera_v2.dae"/>
  </geometry>
</visual>

Leave out the scale, as for the released file: with the file's unit, the mesh has its real size. Gazebo Classic 11 and RViz in ROS 1 Noetic, and gz-sim 8 and RViz 2 in ROS 2 Jazzy, showed the camera and the Teensy at their real size this way, from a test package that held the millimetre files. DiffBot's and Remo's descriptions get a launch argument for such a folder in ros-mobile-robots/diffbot#189 and ros-mobile-robots/remo_description#27.

Checks

CI runs on every pull request:

  1. Regeneration: regenerates all parts twice in the generator environment, each time into a new folder, and fails if any file differs from the manifest's checksum. The check only reads meshes/. The job also writes the millimetre COLLADA files into a folder of their own. scripts/check_millimetre_collada.py compares them with the files in meshes/: each file declares the millimetre, each position is 1000 times the position in metres, and the rest of the file is the same. scripts/check_millimetre_option.py tries the folders that the option has to refuse, among them existing folders with links to released files, and checks that no file changes.
  2. Mesh checks: every STL is closed and consistently oriented. Triangle counts, units and bounding boxes match the manifest. Each COLLADA and glTF file holds the triangles of its STL file, with the same winding. The COLLADA files are valid against the COLLADA 1.4.1 schema and load in pycollada. Each corner of their triangle lists has an index for its position and an index of its own for its normal, which Gazebo Classic needs to shade sharp edges correctly. Each corner's normal index must be its position's index, because a mesh has one normal for each position. The check follows each input to the source that it names: the positions and the normals each come from their own source of the geometry. The glTF files load in trimesh and pass the Khronos glTF Validator. The job also runs the unit tests in tests/: the generators' command line, the grouping of a model's pieces by material, the glTF files' linear base colours, the comparison of the three formats, the COLLADA files' normal indices and sources, the comparison of installed provenance pages with the repository's, and that every part is registered for its pictures, its provenance page and the README.
  3. ROS packages: builds and installs the package in the ros:noetic and ros:humble containers and checks that the installed share/robot_component_models holds exactly the manifest's files, their license files, the manifest, each part's provenance page, generator and frame picture, the generators' other Python files, LICENSE, package.xml and the build tools' own files. Each of these files can be read, each installed provenance page is the repository's page, each page of the manifest exists in the repository, and each relative link of an installed page leads to an installed file. The ROS 1 build is checked with catkin_make_isolated and with colcon.
  4. Code style: flake8 with ROS 2's ament_flake8 settings and mypy, which requires type hints on every function, on the generators, scripts and tests.

Related work

Other collections model similar parts:

  • cq-electronics: electronic boards and components, such as a Raspberry Pi 3B, pin headers and RJ45 jacks, as CadQuery code.
  • KiCad's 3D model libraries and KiCad Library Tools: models of a very large range of electronic components, and the scripts that generate them.
  • Adafruit_CAD_Parts: Adafruit's boards and parts as STEP, Fusion 360 and STL files.
  • NopSCADlib: an OpenSCAD library of bought parts, such as motors, bearings, boards and cameras.

Contributing

Corrections from measurements of the real parts are welcome. See CONTRIBUTING.md.

License

Everything in this repository is under the BSD 3-Clause License, Copyright (c) 2026, ROS Mobile Robots: the CadQuery designs and generators, the generated STL, COLLADA and glTF files, the scripts, the ROS packaging and the documentation. Text files carry the license as SPDX lines in their header. The STL and glTF files, which are binary, carry it in a <file>.license next to them. When you redistribute the meshes, retain the copyright notice, the license conditions and the disclaimer. Including this repository's LICENSE with the distribution does that. The installed package includes it, and also each part's provenance page.

Optional: if you show or share these models, a credit is appreciated, but not required: "Models by ROS Mobile Robots, robot_component_models".

Product names such as Raspberry Pi, Jetson, Teensy and RPLIDAR identify the products these models show. They are trademarks of their owners, and the models carry no logos or brand marks.

About

Independently created display models of robot components (wheels, casters, lidars, single-board computers, microcontrollers) with their CadQuery generators, for ROS 1 and ROS 2

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages