Skip to content

RobotnikAutomation/robotnik_simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues

LinkedIn

Logo Robotnik


=======

robot_simulation

Simulation of Robotnik Automation robots in ROS2!
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Custom Simulation
  5. Roadmap
  6. Contributing
  7. License
  8. Contact

About The Project

Simulation View

This package will combine the different Robotnik packages in ROS2 to simulate the robots in the different available platforms, as Gazebo Sim 8.9.0, etc.

This README will guide you to the simulation usage and the custom simulations that you can build for your own projects.

(back to top)

Getting Started

This package works with the different packages that Robotnik developed for the robots. You will need to install some of these packages first.

Prerequisites

- Gazebo Sim 8.9.0

- ROS2 Jazzy

First, be sure that you have all the Gazebo packages installed for ROS2.

sudo apt install ros-jazzy-ros-gz

Installation

Then, let's procede with the installation of the Robotnik packages. First, create the workspace to work with:

mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src/

Then continue with the installation of packages.

  1. robotnik_description
  2. robotnik_sensors
  3. robotnik_common
  4. robotnik_interfaces
  5. ur_description
  6. robotnik_simulation
git clone https://github.com/RobotnikAutomation/robotnik_description.git -b jazzy-devel

git clone https://github.com/RobotnikAutomation/robotnik_sensors.git -b jazzy-devel

git clone https://github.com/RobotnikAutomation/robotnik_common.git -b ros2-devel

git clone https://github.com/RobotnikAutomation/robotnik_interfaces.git -b jazzy-devel

git clone https://github.com/RobotnikAutomation/Universal_Robots_ROS2_Description.git -b fix/gazebo-control-jazzy

git clone https://github.com/RobotnikAutomation/robotnik_simulation.git -b jazzy-devel

Install the robotnik_controller within the debs folder:

sudo dpkg -i ./robotnik_simulation/debs/ros-jazzy-robotnik-controllers_1.0.0-20250407.075635-7bed613_amd64.deb

Install dependencies:

rosdep update
rosdep install --from-paths src --ignore-src -r -y

Finally, compile workspace:

source /opt/ros/jazzy/setup.bash
cd ~/ros2_ws && colcon build
source install/setup.bash

(back to top)

Usage

Gazebo Ignition

Launch Gazebo

Init the Gazebo world by launching:

ros2 launch robotnik_gazebo_ignition spawn_world.launch.py

Spawn Robot

Once you have the simulation running, you can spawn the robot in the world. For that, there is a launch file that starts all the nodes.

Arguments Default Description
namespace robot namespace that will be in the nodes and topics and differenciate one robot entity from another
robot '' robot type desired to be spawned, must be specified
robot_model same as robot robot_model variation of the robot type. For using this argument, robot has to be fulfilled
robot_xacro_path rbkairos/rbkairos.urdf.xacro path to a xacro model if it is not included in the robotnik_description package
x 0.0 position x in the Gazebo world to spawn the robot
y 0.0 position y in the Gazebo world to spawn the robot
z 0.0 position z in the Gazebo world to spawn the robot
has_arm false If the robot has arm or not to initilize joint_trajectory_controller

With the arguments described above, the launcher creates the robot that you want in Gazebo. As default, it will spawn a RBKairos robot, but you can changed it.

Available robots

  • rbvogui
  • rbtheron
  • rbsummit
  • rbkairos
  • rbrobout

Available robot_model

  • rbkairos_plus
  • rbrobout_plus

Example:

ros2 launch robotnik_gazebo_ignition spawn_robot.launch.py robot:=rbvogui

In case that your robot has a variation (check robots folder in robotnik_description package), you can select it by the argument robot_model.

Example:

ros2 launch robotnik_gazebo_ignition spawn_robot.launch.py robot:=rbkairos robot_model:=rbkairos_plus has_arm:=true

Then, the arguments x, y and z selects the position respect the world frame to spawn the robot.

Control the robot

All the controllers for the robots work with a TwistStamped topic called /namespace/robotnik_base_controller/cmd_vel, the default topic is:

/robot/robotnik_base_controller/cmd_vel

Also it can be used a Twist topic:

/robot/robotnik_base_controller/cmd_vel_unstamped

This topic will move the robot acording to the velocity demanded but it can be also controller by joint commands, using the topic:

/robot/robotnik_base_controller/cmd_joint

Topic type sensor_msgs/msg/JointState.

I recommend to use teleop_twist_keyboard to control by cmd_vel:

sudo apt install ros-jazzy-teleop-twist-keyboard

ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r cmd_vel:=/robot/robotnik_base_controller/cmd_vel -p stamped:=true

Mobile robots with manipulators

There are two mobile bases with a manipulator that can be used:

  • rbkairos_plus
  • rbrobout_plus

To use them launch the spawn of the robot as follows:

ros2 launch robotnik_gazebo_ignition spawn_robot.launch.py robot:=rbkairos robot_model:=rbkairos_plus has_arm:=true

The arm has a joint_trajectory_controller configured that can be used with rqt_joint_trajectory_controller:

sudo apt install ros-jazzy-rqt-joint-trajectory-controller

ros2 run rqt_joint_trajectory_controller rqt_joint_trajectory_controller --ros-args -r __ns:=/robot

Enjoy!

rbvogui_gif

(back to top)

Custom Simulation

In case that the robot model that you want to simulate is not in robotnik_description package, or the world, or you want to use a different controller, you will have to create your own simulaiton files.

This will guide you to create your custom simulation.

Custom Robot Model

  1. First, create your own package for the project.
  2. In this package, create your URDF file. You can base in the template file that are in robotnik_description package.
  3. In the README of robotnik_description there is a brief descripiton on how to create a robot.
  4. On this file you can modify and add all the sensors, arms and any other component.
  5. Then, launch the spawn_robot with the argument robot_xacro_path.

Custom Control

In case that you want to modify the velocity, topics, frames and everything related to the control, you can find the files in robotnik_gazebo_ignition/config folder. There is a file for each robot that you can modify.

Custom world

To launch a custom file, you can use the world_path argument that it's in the spawn_world launch. See Launch Gazebo.

Roadmap

  • Add Gazebo Ignition
  • Add more worlds
  • Add multi robot support

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Top contributors:

contrib.rocks image

(back to top)

License

Distributed under the Unlicense License. See LICENSE.txt for more information.

(back to top)

Contact

Project Link: https://github.com/RobotnikAutomation

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •