This is an external extended code generator service for RobotCAD

RobotCAD is a workbench in FreeCAD - a free CAD. RobotCAD is free software.
RobotCAD is also known as FreeCAD OVERCROSS.

 

Now the development of the basic code for a robot or multicopter to run in a simulation has become instant!
To do this, you only need to press a few buttons. Instead of dozens of hours of reading manuals, writing ROS2 code, Docker code, various configs, trying to make libraries work together and debugging.

 

Features

The external code generator creates:

  • For non-specialized (any) robots: all files from the basic code generator, the project structure (including directories for dependencies collected from the code), the code associated with Docker, the script for building and running the project in a container, Git with submodules for managing dependencies.
  • For multicopters: the same as above + PX4.

The basic code generator creates:

  • ROS2 launch files for running Gazebo (3D simulator) and RViz (a visualizer of various aspects of the robot).
  • URDF (robot structure description file), meshes
  • Required configs and description package for ROS2 (a set of software libraries and tools for creating robots)

 

Work process in RobotCAD

In FreeCAD, you create or import robot parts, then use the RobotCAD workbench tools to define the robot structure (links and joints) and attach your parts (as visuals, collisions, and real parts) to the links, select the materials for the links or the entire robot, set the types of joints and their positions. Click the button to automatically calculate the mass and inertia of the links (based on the selected materials). This data will later be used by the simulation for realistic interaction of the robot with the world.
That's it! All that's left is to click the code generation button.

 

Launch after code generation

After the code generation, you can run the startup script, dependencies will be pulled in, the Docker image will be built, and the container will be launched. For simplicity, all this is wrapped in one command.
Next, in the container, using the commands from the README.md file, we launch the ROS2 launcher with our multicopter. Gazebo and RViz will open. Then we launch PX4, it will automatically connect to our multicopter in the simulation and will be ready to accept the command - "take off".
For non-specialized robots, the launch process is the same, but without launching PX4.

As a result, we have a ready-made infrastructure for the robot, packed in Docker. All this is generated with a few clicks of buttons from the workbench for creating robots - RobotCAD.

We created a robot in RobotCAD and immediately launched it in the simulation.

Congratulations! You have a project with infrastructure, now you can write business logic.

 

Current Docker image build:
  • Common: Ubuntu 22.04, ROS2 Iron, Gazebo Garden, ros_gz, joint_state_publisher_gui
  • Multicopters: common build, PX4 version 14.x, Micro-XRCE-DDS-Agent, px4_msgs, px4_ros_com

The project also creates all the necessary files for launch: airframe, SDF, ROS2 launchers, URDF, etc.

In the airframe, the multicopters have the motor positions relative to the center of mass (as it should be according to the documentation), and not the center of the frame. This makes the drone more stable if the center of mass is shifted.

Tested on Ubuntu 22.04 as host PC.

 

What to do next?

You can use the usual ROS2 and PX4 guides to further program the logic required by your project.

There are plans to expand the capabilities of the code generator, and over time, more will be available through the generator.

 

If you are not familiar with the presented stack of technologies wrapped in Docker, then this is all open source and is one of the most popular solutions for developing robots in the world.