⌚ Time to complete: 3 min
You will have a service running on ROS side, which will allow you to communicate with ROS server from your Unity machine.
Before you proceed, make sure that you have:
Go to the src folder of your ROS workspace:
WORKSPACE_NAME="ws_unity_x_ros"
ROS_WS_PATH=~/ros/${WORKSPACE_NAME}
cd ${ROS_WS_PATH}/src
Clone Unity ROS TCP Endpoint repository:
git clone <https://github.com/Unity-Technologies/ROS-TCP-Endpoint>
Rebuild and source your catkin workspace:
cd ${ROS_WS_PATH}
catkin build
source ${ROS_WS_PATH}/devel/setup.zsh
To launch the endpoint, use the endpoint.launch file located in the launch folder inside the cloned repository:
roslaunch ros_tcp_endpoint endpoint.launch
This will launch the endpoint server at 0.0.0.0:1000 on your the ROS machine. You can connect to it from Unity as described in ⚠How to connect robot in Unity to Robot Control Server.
<aside>
💡 This will launch the endpoint server at 0.0.0.0:1000 on your the ROS machine. You can change the default IP and port by supplying tcp_ip and tcp_port parameters to the launch file, e.g.: roslaunch endpoint.launch tcp_ip:="127.0.0.1" tcp_port:="424242"
</aside>
Done! 🎉