Testing of the robot using GUI

We have already discussed how to build a map of the environment using the robot simulation and robot hardware. In this section, we discuss how to command the robot to go into a particular place of the map. A better way to find the position of the robot in each table is to manually drive the robot using teleoperation.

Assuming that ChefBot packages are configured in both the robot's PC and the user's PC, there should be Wi-Fi networks to which both the robot and user PCs can connect and communicate using the IP assigned to each PC. It should be noted that we have to set ROS_MASTER_URI and ROS_IP, as mentioned in Chapter 10, Integration of ChefBot Hardware and Interfacing it into ROS, Using Python.

The following procedure can be used to test the robots that are working in a hotel environment:

  1. Remote login to the robot PC from the user PC using the ssh command. The command is given as follows:
    $ ssh <robot_pc_ip_address>
    
  2. If the room is not mapped yet, we can map it using the following commands in the robot terminal. Start the robot sensors and the odometry handling nodes using the following command:
    $ roslaunch chefbot_bringup robot_standalone.launch
    
  3. After starting the nodes, we can start the gmapping nodes using the following command:
    $ roslaunch chefbot_bringup gmapping_demo.launch
    
  4. After starting gmapping, we can start the keyboard teleoperation nodes to move the robot using the keyboard:
    $ roslaunch chefbot_bringup keyboard_telop.launch
    
  5. After launching the teleoperation, run RViz in the user system to view the map generated:
    $ roslaunch chefbot_bringup view_navigation.launch
    
    Testing of the robot using GUI
  6. A typical map is given in the preceding figure. It can vary according to the environment. After generating the map, we have to run the following command to save the generated map in the home folder:
    $ rosrun map_server map_saver -f ~/<name_of_the_map>
    
  7. After saving the map, we can start the AMCL node for autonomous navigation:
    $ roslaunch chefbot_bringup amcl_demo.launch map_file:=~/<map_name.yaml>
    
    Testing of the robot using GUI
  8. The robot on the map after starting AMCL is shown in the figure. After running AMCL, start the keyboard teleoperation and move to each table referring the map.
  9. Check whether the robot's position is the same in map and in the actual environment. If there is a huge difference, then we need to remap the room. If there is less difference, we can retrieve and view robot's position near each table with respect to the map, using the following command:
    $rosrun tf tf_echo /map /base_link
    

We will get the translation and rotation value of the robot in each position, as shown in the following screenshot:

Testing of the robot using GUI

Note the corresponding position of the robot near each table and feed it to the GUI code. The editing GUI code must be on the user PC. After inserting the position of the robot in each table on the GUI code, run the GUI node using the following command on the user system:

$ rosrun chefbot_bringup robot_gui.py

The following GUI will pop up and we can control the robot using this GUI.

Testing of the robot using GUI

We can command the robot to go into a particular table by giving the table number on the GUI and pressing the Go button. When we press the Go button, the corresponding goal position is sent to the navigation stack. After testing the GUI, we can deploy the robot on the current environment.

We can see the advantages and disadvantages of this navigation method. The navigation method mainly depends on the ROS framework and programming using Python.

Pros and cons of the ROS navigation

The main highlight of the ROS navigation is that the code is open and reusable. Also, it is simple to understand, even if the handling technology is complex. People with minimal computer knowledge can program an autonomous robot.

The cons of this method are: this is not yet stable and is still in the testing stage, we can't expect high accuracy from this method, and the code may not be of industrial standards.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.105.159