drfenixion / freecad.robotcad

RobotCAD is a FreeCAD workbench to generate robot description packages for ROS2 (URDF) with launchers to Gazebo and RViz.
GNU Lesser General Public License v2.1
100 stars 11 forks source link
cad freecad gazebo robotics ros2 rviz2 urdf workbench

RobotCAD

RobotCAD is a FreeCAD workbench to generate robot description packages (xacro or URDF) for the Robot Operating System, ROS2. RobotCAD also known as OVERCROSS.

RobotCAD 3.0.0 workflow demo RobotCAD 3.0.0 workflow video



RobotCAD 4.0.0 functionality demo RobotCAD 4.0.0 functionality demo

Video of creating controllable models:
Diff drive chassis
Manipulator on chassis
Multicopter with manipulator and chassis
Chassis, manipulator, multicopter parts used in the video

Key features short list:

  1. Autoinstall and run by startup script
  2. Modeling parts (in FreeCAD),
  3. Creating robot structure (joints, links, elements of link (Collisions, Visuals, Reals), etc),
    1. Automatic creating full robot structure by selected objects (links in joints will have order of objects selection)
    2. Automatic creating links by selected objects
    3. Automatic creating joints by selected links
  4. Сonvenient new tools to set placement of joints and links (intuitive way)
    1. Set placement just by selecting faces of links and it will automatically connected
    2. Joint placement rotation tools
    3. Tools for set placement of joints based on LCS or other orienteers.
  5. Material setting (from library or custom) to link or whole robot
  6. Automatic calculation (based on material or custom mass):
    1. mass and inertia
    2. center of mass (in global and local coordinates)
    3. positions of joints relative to the robot's center of mass
  7. Collisions automatic making tools (based on Real element of robot link)
  8. Controllers and sensor data broadcasters based on ros2_controllers (ros2_control)
    1. Add the necessary controllers and broadcasters to the robot and you have a robot ready to be controlled in the simulation
  9. Basic code generator:
    1. ROS2 package with launchers for Gazebo, RViz
    2. URDF
    3. Meshes
  10. Tool for use external extended code generating service (startup script, docker, multicopters)
    1. External code generator:
      1. all of basic code generator
      2. Project structure
      3. Startup script for build and run docker container with all dependencies of project
      4. Init Git with submodules for dependencies management
      5. Docker related code (dockerfiles, etc) (you dont need to manually install ROS2 or Gazebo, it will be installed automatically in docker)
      6. ros2_controllers
      7. Specific robot types code (multicopter - PX4 + Gazebo + ROS2)
      8. Nvidia video cards container support
      9. README instruction how to use
  11. all features from CROSS workbench

Fast install and run

If you have docker (buildx, compose plugins) installed just do

git clone https://github.com/drfenixion/freecad.robotcad.git
cd freecad.robotcad/docker
bash run.bash

Tested on Ubuntu 22.04 and Windows 10 via WSL2 (Ubuntu).

If docker is not installed look at docker/README.md. There is also additional information on how to use the startup script.

You also can install RobotCAD manually via FreeCAD Addon manager by Installation section

RobotCAD will not work with CROSS workbench (same namespace). Remove CROSS before install RobotCAD.

Update RobotCAD

use commands in RobotCAD directory

git pull
cd docker
bash run.bash

Recreate container

In case of start issue (transfer from 3.0.0 to next version may need "-f") recreate container by

bash run.bash -f

Screenshots

Launched RViz and Gazebo using generated code:

RViz RViz

Gazebo - Basic view basic

Gazebo - Joints view joints

Gazebo - Collisions view collision

Gazebo - Inertia view inertia

One more robot

Choosing of material of robot or link Choosing of material of robot or link

Generated ROS 2 package

Generated ROS 2 package

Launched Rviz and Gazebo from generated Gazebo launcher Launched Rviz and Gazebo from gazebo launcher

Generated inertia blocks and centers of mass in Gazebo Generated inertia blocks and centers of mass in Gazebo

Generated collisions in Gazebo Generated collisions in Gazebo

Usage

Common usage plan

Description

RobotCAD is a powerful ROS workbench for FreeCAD, a popular open-source 3D parametric modelling software. As the field of robotics continues to evolve rapidly, the need for comprehensive and efficient tools for robot development and simulation has become increasingly essential. RobotCAD emerges as a versatile solution, empowering engineers, researchers, and hobbyists to leverage the capabilities of both ROS and FreeCAD in a cohesive environment. At the time of writing (June 2023), RobotCAD is the only available open-source solution to generate robot description files for ROS with a graphical user interface with direct visual feedback.

With RobotCAD, users gain the ability to combine the flexibility of FreeCAD's 3D modeling capabilities with the extensive functionality of ROS, allowing for seamless collaboration between mechanical design and robotics development. By bridging the gap between these two powerful platforms, RobotCAD streamlines the process of designing, and visualizing robotic systems, ultimately accelerating the development cycle.

The key features of RobotCAD are:

Compatibility

Compatible with FreeCAD at least v0.21.2. Compatible with ROS2.

Features

Installation

You need a recent version of FreeCAD v0.21.2 with the ability to configure custom repositories for the Addon Manager to install the workbench via the Addon Manager. On earlier version you're on your own, see instructions for local install below.

Launching FreeCAD with ROS

The RobotCAD workbench is supposed to load also without ROS, with limited functionality. If this is not the case, please report.

You will probably want to be able to use ROS-related functionalities and this requires launching FreeCAD from the command line:

(Optional) You can also set extra Python modules

Testing/developing the workbench

If you want to work on this workbench you have the following options (choose one):

New code will not automatically load to FreeCAD. You should restart FreeCAD by bash run.bash -d command for getting affect of corrected code.