This is an Unity Script for ROS-Unity integration. You can move an arm robot on Unity from ros2_control with this script.
- ROS version: ROS 2 humble
- Unity version: 2022.3.46 or above
- ROS packages
- topic_based_ros2_control plugin
- Unity packages
- ROS-TCP-Connector
- URDF-Importer
- Driven joints must be of type "revolute".
- Robot must be of 6 DOF.
- Topics for joint commands and joint states must be ordered from the base to end (near end-effector).
This script depends on topic_based_ros2_control plugin, which is ros2_control hardware component for integration. See https://github.com/PickNikRobotics/topic_based_ros2_control.
You must have <ros2_control>
tag with topic_based_ros2_control plugin on your URDF.
The parameters joint_commands_topic
and joint_states_topic
must be the same with the topic names configured on Unity script.
You must copy the ROS-Unity integration script RosJointControl.cs
to your Unity project and add it to a Game Object.
Set the script properties below:
- Joint Names
- Joint names in URDF to drive.
- Joint States Topic Name
- Topic name for joint commands. This must be the same with the topic_based_ros2_control parameter
joint_commands_topic
.
- Topic name for joint commands. This must be the same with the topic_based_ros2_control parameter
- Joint States Topic Name
- Topic name for joint states. This must be the same with the topic_based_ros2_control parameter
joint_states_topic
.
- Topic name for joint states. This must be the same with the topic_based_ros2_control parameter
- Urdf Robot
- Manipulation target robot object imported by URDF-Importer.
See https://github.com/wildlarva/example-ros-unity-integration.