Simulating MARA modular robot with Gazebo

Gazebo simulation mara

Gazebo offers the ability to accurately and efficiently simulate populations of robots in complex indoor and outdoor environments. At your fingertips is a robust physics engine, high-quality graphics, and convenient programmatic and graphical interfaces. Best of all, Gazebo is free with a vibrant community.


SIMULATION

Robot simulation is an essential tool in every roboticists toolbox. A well-designed simulator makes it possible to rapidly test algorithms, design robots, and perform regression testing using realistic scenarios.


You can install ROS 2.0 in today's main platforms: Windows, Linux and OSX. You have two options to do it, here we provide some links to the official documentation:

Our recommendation is to create a dedicated workspace for MARA modular robot however as always, if you know what you're doing, feel free to fetch these packages into your usual workspace.

Create a dedicated ROS2 workspace for MARA as follows: xc

mkdir -p ~/ros2_mara_ws/src
cd ~/ros2_mara_ws
sudo apt install -y python3-vcstool python3-numpy
wget https://raw.githubusercontent.com/acutronicrobotics/MARA/master/mara-ros2.repos
vcs import src < mara-ros2.repos

As a modular robot, MARA uses a common interface to ensure interoperability across modules. Such interface is defined by the Hardware Robot Information Model (HRIM). First thing we should do is to generate the HRIM dependencies:

pip3 install hrim
cd ~/ros2_mara_ws/src/HRIM
hrim generate models/actuator/servo/servo.xml
hrim generate models/actuator/gripper/gripper.xml

Read more about HRIM below our Technology section.

source /opt/ros/kinetic/setup.bash

Right now you can compile the code:

source /opt/ros/crystal/setup.bash
cd ~/ros2_mara_ws && colcon build --merge-install

Addressed by:

export LIBRARY_PATH="/usr/local/Cellar/bullet/2.88/lib/:$LIBRARY_PATH"

export LIBRARY_PATH="/usr/local/Cellar/gazebo9/9.7.0/lib/:$LIBRARY_PATH"

Instuctions cooked in OS X Mojave 10.14. Minor changes may apply depending on your OS.

Get the environment ready and launch Gazebo:

source ~/ros2_mara_ws/install/setup.bash
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:~/ros2_mara_ws/src/MARA
gazebo --verbose -s libgazebo_ros_factory.so &

You should see an empty Gazebo world, let's spawn MARA's model:

python3 /Users/victor/ros2_mara_ws/install/lib/mara_utils_scripts/spawn_entity.py &

Finally, we can bring up MARA's logic as follows:

ros2 launch mara_bringup mara_bringup.launch.py &

this should get you something like:

victor:~/ros2_mara_ws$
| => ros2 node list
/gazebo
/mara_joint_state
/hros_actuation_servomotor_000000000001
/hros_actuation_servomotor_000000000002
/hros_actuation_servomotor_000000000003
/hros_actuation_gripper_000000000004
/launch_ros
/robot_state_publisher

| victor:~/ros2_mara_ws$
| => ros2 topic list
/hros_actuation_gripper_000000000004/id
/hros_actuation_gripper_000000000004/power
/hros_actuation_gripper_000000000004/specs
/hros_actuation_gripper_000000000004/specs_comm
/hros_actuation_gripper_000000000004/state_comm
/hros_actuation_gripper_000000000004/state_finger_gripper
/hros_actuation_gripper_000000000004/state_gripper
/hros_actuation_gripper_000000000004/status
/hros_actuation_servomotor_000000000001/goal
/hros_actuation_servomotor_000000000001/id
/hros_actuation_servomotor_000000000001/module_3d
/hros_actuation_servomotor_000000000001/module_urdf
/hros_actuation_servomotor_000000000001/power
/hros_actuation_servomotor_000000000001/specs
/hros_actuation_servomotor_000000000001/specs_comm
/hros_actuation_servomotor_000000000001/state
/hros_actuation_servomotor_000000000001/state_comm
/hros_actuation_servomotor_000000000001/status
/hros_actuation_servomotor_000000000001/trajectory
/hros_actuation_servomotor_0000000000012/goal
/hros_actuation_servomotor_0000000000012/state
/hros_actuation_servomotor_0000000000012/trajectory
/hros_actuation_servomotor_000000000002/goal
/hros_actuation_servomotor_000000000002/id
/hros_actuation_servomotor_000000000002/module_3d
/hros_actuation_servomotor_000000000002/module_urdf
/hros_actuation_servomotor_000000000002/power
/hros_actuation_servomotor_000000000002/specs
/hros_actuation_servomotor_000000000002/specs_comm
/hros_actuation_servomotor_000000000002/state
/hros_actuation_servomotor_000000000002/state_comm
/hros_actuation_servomotor_000000000002/status
/hros_actuation_servomotor_000000000002/trajectory
/hros_actuation_servomotor_0000000000022/goal
/hros_actuation_servomotor_0000000000022/state
/hros_actuation_servomotor_0000000000022/trajectory
/hros_actuation_servomotor_000000000003/goal
/hros_actuation_servomotor_000000000003/id
/hros_actuation_servomotor_000000000003/module_3d
/hros_actuation_servomotor_000000000003/module_urdf
/hros_actuation_servomotor_000000000003/power
/hros_actuation_servomotor_000000000003/specs
/hros_actuation_servomotor_000000000003/specs_comm
/hros_actuation_servomotor_000000000003/state
/hros_actuation_servomotor_000000000003/state_comm
/hros_actuation_servomotor_000000000003/status
/hros_actuation_servomotor_000000000003/trajectory
/hros_actuation_servomotor_0000000000032/goal
/hros_actuation_servomotor_0000000000032/state
/hros_actuation_servomotor_0000000000032/trajectory
/joint_states
/parameter_events
/robot_description
/tf
/tf_static