Skip to content

RobotnikAutomation/robot_simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues

LinkedIn


Logo =======

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 Classic, Gazebo Ignition, 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

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

sudo apt install ros-humble-gazebo-ros-pkgs

Installation

Then, let's procede with the installation of the Robotnik packages.

  1. Init the submodules of this repository

    git submodule init && git submodule update
  2. Install robotnik_controller dependencies

    sudo dpkg -i debs/*.deb

(back to top)

Usage

Gazebo Classic

Launch Gazebo

Init the Gazebo world by launching:

ros2 launch robotnik_gazebo_classic spawn_world.launch.py

There are some arguments that allows you to change the world, in case that you want to use a custom world.

Arguments Default Description
world demo This arguments selects a world in worlds folder.
world_path demo.world In the case that you have your own world to simulate, introduce the path to the world file.

Example:

ros2 launch robotnik_gazebo_classic spawn_world.launch.py world:=maze

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.

ros2 launch robotnik_gazebo_classic spawn_robot.launch.py
Arguments Default Description
namespace robot namespace that will be in the nodes and topics and differenciate one robot entity from another
robot rbkairos robot type desired to be spawned
robot_model value of robot argument 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 robot_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

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 by:

  • rbvogui
  • rbtheron
  • rbsummit
  • rbkairos

Example:

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

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

Example:

ros2 launch robotnik_gazebo_classic spawn_robot.launch.py robot:=rbkairos robot_model:=rbkairos_ur

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 Twist topic called /namespace/robotnik_base_controller/cmd_vel, the default topic is:

/robot/robotnik_base_controller/cmd_vel

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

/robot/robotnik_base_controller/joint_control_command

This topic is from type sensor_msgs/msg/JointState.

I recommend to use teleop_twist_keyboard to control by cmd_vel:

ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-arg cmd_vel:=/robot/robotnik_base_controller/cmd_vel

Enjoy!

rbvogui_gif

(back to top)

Custom Simulation

In case that the robot model that you want to simulate is not in robot_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 robot_description package.
  3. In the README of robot_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_classic/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 Classic
  • 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