![Logo](/RobotnikAutomation/robot_simulation/raw/master/img/LOGO BLANCO-ROJO.png)
Simulation of Robotnik Automation robots in ROS2!
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
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.
This package works with the different packages that Robotnik developed for the robots. You will need to install some of these packages first.
First, be sure that you have all the Gazebo packages installed for ROS2.
sudo apt install ros-humble-gazebo-ros-pkgs
Then, let's procede with the installation of the Robotnik packages.
-
Init the submodules of this repository
git submodule init && git submodule update
-
Install robotnik_controller dependencies
sudo dpkg -i debs/*.deb
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
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.
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
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.
- First, create your own package for the project.
- In this package, create your URDF file. You can base in the template file that are in robot_description package.
- In the README of robot_description there is a brief descripiton on how to create a robot.
- On this file you can modify and add all the sensors, arms and any other component.
- Then, launch the spawn_robot with the argument robot_xacro_path.
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.
To launch a custom file, you can use the world_path argument that it's in the spawn_world launch. See Launch Gazebo.
- 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).
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the Unlicense License. See LICENSE.txt
for more information.
Project Link: https://github.com/RobotnikAutomation