-
Notifications
You must be signed in to change notification settings - Fork 8
R1 navigation System setup instructions
First of all, even if it can come as a no brainer, check that the robot is turned on. For this specific task both the PC's
and the motors
of the robot have to be on. Check the little display con R1 base and look for two small rectangular bars near the labels CPU
and Motors
. They have to be green (if red, press the button correspondent to the red bar, PC
for CPU
and Motors
for the other one).
Since this is not going to be a short procedure, you should keep the robot connected to the power supply in order to have the robot's battery as charged as possible.
On your setup laptop, open 3 terminals.
The first one will be for the robot base. The second one will be for the torso's board and the third one for the docker container that will have to run on the laptop
On the first terminal connect to the base (192.168.100.10) via ssh with -X
to enable the graphical interface and simply launch terminator
For convenience, divide this newly opened terminal in three (either right click inside the terminator and select "Split vertically/horizontally" or press Ctrl+Shift+E
or Ctrl+Shift+O
for splitting vertically or horizontally). In the first "sub-terminal" launch a new tmux
instance by typing
$> tmux new -s yarpserver
Now, launch the yarp server inside this new command line
$> yarpserver
Once it's up and rolling, press Ctrl
+b
and then d
.
On the second "sub-terminal" open another tmux session
$> tmux new -s dockerbase
In this new session got to the folder containing the Dockerfile for this specific setup
$> cd $ROBOT_CODE/tour-guide-robot/docker_stuff/docker_core2
now simply type
$> ./start-docker-core.sh -s
You'll be asked to enter the user password.
After that, open a yarp run server
$> yarp run --server /r1-base --log
Now, just detach from the tmux session (press Ctrl
+b
and then d
).
In last "sub-terminal" open again another tmux session
$> tmux new -s joystick
- For the xbox 360 pad: Turn on the joystick (by long pressing the
XBox
button) and, once the green light on the pad is steadily on, go to the previously opened tmux session and type
$> joystickCtrl --context navigation2 --from joystick_cer_linux_high_speed_xbox.ini --force_configuration --GENERAL::outputPortName /joystickCtrl:o
- For the stratus steelseries: move the switch on the backside of the controller on ON and check whether or not the for LEDs on the front are blinking or not and then go to the previously opened tmux session and type
$> joystickCtrl --context navigation2 --from joystick_cer_linux_high_speed_stratus.ini --force_configuration --GENERAL::outputPortName /joystickCtrl:o
In either one of the previous cases, detach from the tmux session (press Ctrl
+b
and then d
).
On the torsos's terminal connect via ssh to the torso board the realsense camera is connected to (either torso1
192.168.100.21 or torso2
192.168.100.22).
Now open a tmux session
$> tmux new -s torso
Launch, then, a yarp run server
$> yarp run --server /r1-torso --log
And detach from the tmux session
From the laptop terminal go to the folder containing the Dockerfile for this task
$> cd $ROBOT_CODE/tour-guide-robot/docker_stuff/docker_core2
now simply type
$> ./start-docker-core.sh -s
Now launch, for convenience, terminator
Divide this newly opened terminal into three sub-terminals
At first edit the configuration of cyclone dds. In one terminal edit the file /home/user1/tour-guide-robot/app/navigation2/conf/cyclone_dds_settings.xml
. The file must be edited as follow (you need only to change the two IP):
<CycloneDDS>
<Domain>
<General>
<AllowMulticast>false</AllowMulticast>
<Interfaces>
<NetworkInterface address="192.168.100.3" priority="default"/>
</Interfaces>
</General>
<Discovery>
<MaxAutoParticipantIndex>30</MaxAutoParticipantIndex>
<ParticipantIndex>auto</ParticipantIndex>
<Peers>
<Peer address="localhost"/>
<Peer address="192.168.100.10"/>
</Peers>
</Discovery>
</Domain>
</CycloneDDS>
(Replace 192.168.100.3
in the Interfaces
tag with the IP of your laptop if it is different.)
In the first sub-terminal launch a yarp run server:
$> yarp run --server /console --log
Then in the second terminal launch a yarp logger:
$> yarplogger --start
In the end launch a yarp manager
$> yarpmanager
Once everything is set up, you need to start all the various modules.
Go to yarp manager, open the application Navigation_ROS2_R1SN001
and run all the applications, except joystickCtrl
that you already started on r1-base
terminal.
Always remember to launch one module at the time and wait for the red icon shown for every module to become green beforse starting the other applications. Given that, read the following lines before starting any module if you are following this tutorial for the first time.
Since the robot is going to do a series of movements in order to calibrate itself, before launching on yarpmanager the yarprobotinterface, move the robot away from obstacles in order to avoid collisions.
Once you hit run
on yarpmanager for the yarprobot interface wait for the robot to complete its calibration before proceeding with the rest of the modules.
Some times some motors do not start as expected. To check the status of all the motors you can use the yarpmotorgui
. In the fpollowing collapsed section you will find a set of simple instructions to check the system with this tool.
Beware: this tool gives you the ability to control each joint of the robot independently. If not used with care can potentially damage the robot. Use it only to check the status of all the robot joints unless you know what you are doing
Open me
For convenience open a new tab in the laptop docker terminator terminal (either click with the mouse right button on the terminal and select "Open tab" or, with the terminal on focus, press `Ctrl+Shift+t`), go to the robot configuration folder
$> cd /home/user1/robotology/robots-configuration/R1SN001
From here run the following command
$> yarpmotorgui
On the dialog that will appear after launching the command, un-check the /cer/all_joints
option and click ok.
Once the dialog is opened check all the tab for grey, yellow or red colored joints.
- Grey means that the joint is disabled. Usually it is presented like that because the joint initialization procedure went wrong and the
yarprobotinterface
disabled it for safety. To make it work again you have to stopyarprobotinterface
and run it again. - Yellow means that the joint is in an idle state. Always minding that if you don't know the system well you should not take any action unless you are supported by someone with more experience, you can hit the "Run" button to see if the joint area turns green. If it doesn't, you can either close the
yarprobotinterface
and try and run it again or, if you do not need the joint for your test, you can leave it in the idle state. - Red means that the joint is in a faulty state. If you know the robot and understand what it means, you can try and press the "Idle", wait for the joint area to turn yellow and then press "Run". If it turns green, the joint should be fine. If it doesn't, you can either close the
yarprobotinterface
and try and run it again or, if you do not need the joint for your test, you can leave it in the idle state.
The third module in the yarpmanager app is the pointCloudCreator
. This module can take some time before being ready to run, so if at a first click on the run button on yarpmanager the module does not start, just wait a little bit.
Once you have followed the tips shown in the lines above, you can proceed with the other applications and then connect all and you should be able to control the robot via the joystick.
Once rviz2
is opened, verify that you can see the map, the tf tree of the robot, the laser (a set of red dots around the robot) and the local costmap (a square area centered around the robot that shows with a color gradient the actual planning cost for the robots surroundings). If not, probably something went wrong and you need to stop and restart the last 5 modules in the yarpmanager application.
If this doesn't solve the issue, try and stop again the aforementioned modules, got to the r1-base
terminator, connect to the running docker container and check for amcl
related processes using ps aux
. If you find any, just kill them and then try again to run the last five modules of the yarpmanager application.
The last resort, if this last solution doesn't work is to stop every module in the yarpmanager application, close all the things you opened in this tutorial, shutdown the robot and restart the tutorial from the beginning.
If do not encounter any issue (or you are able to overcome them) you can now try and localize the robot using the rviz
2D Pose estimate
function.
On the top tool bar of rviz2
click on 2D Pose Estimate
, then press down the left mouse button on the point on the map where robot really is (you don't have to be 100% precise, is just to initialize the localization) and drag in the direction the robot is facing (again, the precision doesn't need to be absolute).
Once the robot is localized, you can unplug it from the power supply and then you are ready to navigate
On the top tool bar of rviz2
click on 2D Goal Pose
. Then press down the left mouse button on a point in the map you want the robot to go and drag in the direction you want the robot to face at the end of the movement.
For starters, select a point not to far from the current robot position and be ready to block the robot with the joystick if something goes wrong (Follow the tips in the next paragraph for using the joystick)
Once you connected the joystick port to baseControl2
you will be able to use the joystick to move the robot around.
By pressing down the RT button (right trigger) button you gain control of the robot base. By moving the left stick down or up the robot will either move back or forward and by moving the right stick left or right the robot will rotate either counterclockwise or clockwise.
By pressing the button B
you will disable the wheels motors and by pressing the A
one you will reenable them. These two buttons are particularly useful to stop the robot to avoid unwanted movements and to be able to move the robot by pushing it around.
By pressing X
or Y
you will change the robot speed. X
for the lower speed and Y
the higher one. If you want to be conservative, you should always use the lower one.
If the joystick light should ever come off, stop the joystickCtrl
executable on r1-base
by connecting again to the tmux session
$> tmux a -t joystick
and pressing Ctrl+C
. Restart then the joystick executable (see r1-base section) and detach from the tmux session.
Now go back to yarpmanager and reconnect the joystick port to the baseControl one.