-
Notifications
You must be signed in to change notification settings - Fork 15
ReplaceRobot
To replace the Jackal robot from this demo you'll have to do the following steps:
(This list assumes, that you have the robot installed and working on your linux machine)
- Install the required packages This package is required to send stl and mesh files from the linux machine to unity.
// install file_server package
$ cd /home/ && git clone https://github.com/EricVoll/ros-sharp.git
$ mv /home/ros-sharp/ROS/file_server /home/catkin_ws/src
$ rm -r -f /home/ros-sharp
$ cd /home/catkin_ws
$ catkin_make
$ source /home/catkin_ws/devel/setup.bash
- Write a roslaunch file similar to this one
(This is the roslaunch file which was used to import Jackal into Unity) and place it in the launch directory of the file_server package. The roslaunch file has to:
- Start the file_server package, which will later allows Ros# to import stl files.
- Write the urdf content of your robot in the
robot_description
parameter on the parameter server - Write the robot's name in the
robot/name
parameter.
- Import the robot
For that, follow this tutorial from the original Ros# repository. In principle, your robot is now present in the Unity game.
Everything that's left is to configure the Demo scene to listen to the correct topics and to publish to the correct topics.
Do the following:
- Add a
JointStateSubscriber
and aJointStatePatcher
component to the RosConnector - Assign the Field
UrdfRobot
of theJointStatePatcher
with the topmost GameObject of your imported Robot - Click "Enable" right next to "Subscribe Joint State". The Editor script will auto assign all references for you.
- If you want the base of your robot to move as well (e.g. mobile robots) add a
OdometrySubscriber
to the RosConnector and configure the correct Topic to subscribe to. Then assign thePublished Transform
reference with the base GameObject's Transform of your robot. In theory you can of course also add multipleOdometrySubscribers
if your robot requires you to do so. - You can also add Path visualization. To do that, add a prefab called "PathVisualization" as a sibling to your Robot-GameObject, and a NavigationPathSubscriber to the RosConnector, and configure their paths accordingly.
The process for adding JointStatePublisher
s is pretty much the same and self explanatory.
The ExecutableStampedPosePublisher
maybe has to be adjusted to the correct topic, where you'd like to send the goal-pose to. That depends on the trajectory planner you are using.
0. Home
1.1 Installing required components
1.2 Running the demo
1.3 Building the demo from source
1.4 Demo features
2.1 Repository Overview
2.2 ROS & networking
2.3 ROS#
2.4 Unity app architecture
3.1 How to replace the robot
3.2 How to add more robots!
3.3 How to extend the MR app