Running the Actual ROSBot
If have you a Husarion ROSbot you can try out Mowito’s Navigation stack directly on it.
Connect To ROSBot
1. Get the ROSbot connected to a wifi
1.1. Connect a screen and keyboard with ROSBot, and then connect the ROSbot to the wifi.
1.2. Get the Laptop (ground station) on the same network as the ROSbot. This laptop will be used give goals to the ROSbot and visualize the path, sensore input and other info from the ROSbot
2. Get the IP address of the RObot
2.1. Open the terminal
- 2.2. execute the followin command
hostname -I
The output is the IP address of the ROSbot, note it down.
3. SSH into the ROSbot
- 3.1. Open the terminal on your laptop and execute the following
ssh husarion@<ip address of the ROSbot>
- 3.2. If you avahi daemon running on the robot then you can instead try
ssh husarion@husarion.localwhere husarion is the user name and hostname of the ROSbot respectively.
4. Export ROS_IP on ROSBot
- 4.1. SSH into the ROSbot and execute the following :
export ROS_IP=<ip address of the ROSbot>
- 4.2. If you have avahi daemon running then you can instead try:
export ROS_IP=husarion.local
where husarion is the hostanme of your ROSbot
You have to execute the above commands every time you ssh into ROSbot to run Mowito’s navigation stack.
5. Setup the Laptop (ground station)
- 5.1. Export ROS_IP
Get the IP address of the laptop, by executing the following on the laptop’s terminal
hostname -I
then on the same terminal
export ROS_IP=<ip address of the laptop>
- 5.2. Export ROS_MASTER_URI
One same terminal execute the following:
export ROS_MASTER_URI=http://<ip address of the ROSbot>:11311
You have execute above two commans on each terminal of Laptop (Ground station) which you want to use for communicating to the ROSbot.
Setup Mowito’s Stack On Robot
User Registration
If you have already done, you can skip this step.
Register yourself on this website https://mowito.in/navigation_stack.html
We need your email to mail you the password, and to count how many people are using Mowito.
We won’t spam. :)
Installation Mowito Navigation Stack
SSH into the ROSBot
- Create mowito directory
mkdir -p ~/mowito_ws/src/
- Clone the repo containing the debians:
cd ~/mowito_ws/src
for ROS melodic on arm 64
git clone https://github.com/mowito/mowito_arm64.git --branch melodic
for ROS kinetic on armV7 (armhf) git clone https://github.com/mowito/mowito_armv7.git --branch kinetic
- Remove any previous installation of Mowito stack
cd mowito_arm64 or cd mowito_armv7 based on arm 64 or armV7 respcectively.
for ROS melodic
./remove_mowito.sh melodic
for ROS kinetic
./remove_mowito.sh kinetic
- Install the new Mowito stack
For ROS melodic
./setup_mowito.sh melodic
For ROS kinetic
./setup_mowito.sh kinetic
- In the end, the setup will ask for the uesr registeration.
Use the user name you used on the registration website and password that was mailed to you. You can use any name as robot name.
Installation of Mowito Rosbot Package
Mowito Rosbot package simply contains the necessary launch files and config files, which Mowito team create for easy deployment on ROSbot.
- SSH into the ROSBot
- clone the Mowito ROSbot package into the mowito_ws
cd ~/mowito_ws/src && git clone https://github.com/mowito/mowito_rosbot.git
- Build the Mowito ROSbot package.
cd ~/mowito_ws && catkin_make
of if you use catkin build tools
cd ~/mowito_ws && catkin build
- source the mowito_ws whenever you need to run mowito_rosbot
source ~/mowito_ws/devel/setup.bash
TIP:: you can add the above command in you ~/.bashrc so that its atuomatically executed everytime you open the terminal.
Navigation - Without Map
During this phase, for navigation the robot, you can use two methods
- Manual Navigation - Using Tele-Operation
- Autonomou Navigation - By giving goals through Rviz
Method 1 : Manual Navigation
Step 0 : SSH into the rosbot and on it source the workspace
ssh husarion@husarion.local
source ~/mowito_ws/devel/setup.bash
Step 1 : Launch the mw_mapping node
- With Mowito Mapping (default)
roslaunch mowito_rosbot run_mw_mapping.launch
- With cartographer
roslaunch mowito_rosbot run_mw_mapping.launch cartographer:=true
Step 2 : Launch the remote control for providing commands to the bot
in another terminal, SSH in into rosbot and run the following command :
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
Method 2 : Autonomous Navigation
Here, the robot will explore the map based on the goal destination provided by the user on RViz.
Step 0 : SSH into the rosbot and on it source the workspace
ssh husarion@husarion.local
source ~/mowito_ws/devel/setup.bash
Step 1 : Launch the Mowito Navigation without Map
- With Mowito mapping.
roslaunch mowito_rosbot run_mw_navigation_with_no_map.launch
- With Cartographer
roslaunch mowito_rosbot run_mw_navigation_with_no_map.launch cartographer:=true
Step 2: Provide Goal
Open another terminal, export ROS_MASTER_URI and ROS_IP and then source ROS and start rviz:
rviz
The goal can be provided on RViz using the “2D Nav Goal” feature provided on RViz.
The icon is highlighted in red in the image below.
Saving the Map
Once you are done creating the map on rviz, for saving the map on a new terminal, ssh into rosbot and based on the mapping tool you were using execute the following command:
1) Mowito Mapping (defautl)
cd && rosrun map_server map_saver -f mymap
the map (pgm and yaml) is saved in the home directory with the name mymap.pgm and mymap.yaml
2) Cartographer , run the following command
rosrun mowito_rosbot save_carto_map.sh map_name
the map (pbstream) is saved in the home directory with the name map_name.pbstream. If no map_name is given then it would save as map.pbstream
Navigation - With Map
Step 0 : SSH into ROSBot and Source the workspace
source <path_to_mowito_ws>/devel/setup.bash
Step 1 : Place the robot
Preferable place the robot at the origin of map (the place where you started mapping)
Step 2 : Run the Mowito’s Navigation Stack
Open a terminal and SSH into the ROSBOT
1. Using map made from Mowito Mapping (in previous step)
roslaunch mowito_rosbot run_mw_navigation.launch
If you want to use the map created in the previous section use the following command
roslaunch mowito_rosbot run_mw_navigation.launch map_path:=/home/husarion/mymap.yaml
2. Cartographer based Localization
Use this if you created the map from cartographer in the previous step
roslaunch mowito_rosbot run_mw_navigation.launch cartographer:=true
Step 3 : Give the goals
In another terminal, export the ROS_MASTER_URI and ROS_IP, source ros and start rviz:
rviz
In the rviz, click on the second top panel, click on the nav goal option, and click on the displayed map to give goal to the robot.
Setting Up Rviz
Rviz is a tool for visualizing what the robot is seeing. Further, it could also provide GUI for the user to interact with the robot. Rviz can be opened in the computer (with screen) - most probably not the ROSbot, using the command rviz (after sourcing ROS).
In order to visualize all the interesting information on Rviz you have to add the topics on which they are getting published. You can find more information on this http://wiki.ros.org/rviz/UserGuide
To add a topic of visualisation:
- On the left “Display” pane, click on “add”
- Click on “by topic”
- select the topic name
- click on “ok”
now you one-by-one you have to add the following topics:
scan /map /plan /costmap/local_costmap/footprint /free_paths /local_path
for visualizing the axis of the robot and other frames:
- On the left “Display” pane, click on “add”
- Click on “by display type”
- select “axes”
- click on “ok”
Once you are satisfied with the configuration, click on File > save config, so that you don’t have to configure Rviz everytime you open it.