ROS integration for the Hydra multi-robot system. This ROS2 metapackage provides launch files and configuration for the Hydra multi-robot system. See this repository's branches for different variants of the multi robot system configuration.
Note
ros2 variant:
The ros2 branch contains the default setup: Three robots spaced evenly around a 1-DOF positioner table.
When running the multi-robot system on the physical hardware, it is recommended to build the Docker image and use the scripts provided in za_docker (on each robot computer). If you only plan to run the system in simualtion, this is not required.
Create a ROS 2 workspace and clone this package into a src directory.
Import package dependencies:
sudo apt update
rosdep update
cd src
vcs import < hydra_ros/hydra.repos
rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y
Build the packages:
cd <COLCON_WORKSPACE>
colcon build
To view the system in Rviz, run the following command after sourcing your bash file:
ros2 launch hydra_bringup hydra_visualization.launch.pyThere are two forms of simulation for the system. The first uses the
sim_hw_interface from
ros_control_boilerplate.
The second uses the sim version of the hal_hw_interface from
hal_ros_control. For more
information on the differences between these hardware interface see the README
in
za_hardware.
Launch all hardware interfaces and controllers on the same computer using the sim_hw_interface:
ros2 launch hydra_bringup hydra_system_sim.launch.py rviz:=trueFrom here you can run any custom controllers or start MoveIt! to begin planning.
Alternatively, you can run the system in simulation using the
hal_hw_interface. The hydra_robot.launch file wraps the normal Za6 bringup in
a namespace. The launch file should be run in seperate Docker containers. This
works on seperate robot computers or all on the same machine. Launch all
hardware interfaces (hal_hw_interface) in seperate docker containers and
visualize the system:
# docker container 1
ros2 launch hydra_bringup hydra_robot.launch.py hardware:=hal arm_id:=rob1
# docker container 2
ros2 launch hydra_bringup hydra_robot.launch.py hardware:=hal arm_id:=rob2
# docker container 3
ros2 launch hydra_bringup hydra_robot.launch.py hardware:=hal arm_id:=rob3
# host computer
ros2 launch hydra_bringup hydra_visualization.launch.pyThe "motors" can be activated by publishing the following ROS messages to the hardware interface from the host computer:
ros2 topic pub /rob1/hal_io/state_cmd std_msgs/UInt32 "data: 2"
ros2 topic pub /rob2/hal_io/state_cmd std_msgs/UInt32 "data: 2"
ros2 topic pub /rob3/hal_io/state_cmd std_msgs/UInt32 "data: 2"The only difference here is that the sim:=false argument should be passed to
the robot launch when running the hardware interface that will actually connect
to EtherCat. Note: See za_docker
for instructions on running the containers in execution mode
# docker container 1 on robot 1 computer
ros2 launch hydra_bringup hydra_robot.launch.py hardware:=hal sim:=false arm_id:=rob1
# docker container 2 on robot 2 computer
ros2 launch hydra_bringup hydra_robot.launch.py hardware:=hal sim:=false arm_id:=rob2
# docker container 3 on robot 3 computer
ros2 launch hydra_bringup hydra_robot.launch.py hardware:=hal sim:=false arm_id:=rob3
# host computer
ros2 launch hydra_bringup hydra_visualization.launch.pyAfter engaging the motors with the commands listed above, you can begin planning with MoveIt!.
MoveIt! has limited functionality for coordinated planning in multi-robot systems. However, it still works for point-to-point collision-free motion. You can use MoveIt! to plan for the Hydra system using any of the runtime configurations listed above.
# host computer
ros2 launch hydra_bringup moveit_planning.launch.py