Skip to content

Creating a map (not supported on the Origin One 1.0/1)

Corresponding components: Origin platform, Autopilot

Important

Make sure to follow the procedure of a Manual drive up until you are able to manually control the robot using the remote controller

Important

Make sure that you aligned with Avular personnel prior to the delivery of your Origin One on the position of the (Avular branded) Aruco markers.

The robot requires a map of the environment before it is able to autonomously navigate from a starting position to a destination. The type of map that is required by the robot is a 2D floorplan, which indicates the positions that are either: A. free to maneuver, or B. occupant by some object, or C. still unknown. An example of such a map with those three positions is depicted below.

FloorPlan

Creating a map requires some technical background knowledge, but with some basic experience in Linux you should be fine. The next steps guide you through this process, yet more details for a developer can be found at autopilot-mapping. Herein, we will assume that the hostname of your Origin One is "Origin-15", but that is interchangeable with the name of your Origin One.

  1. Open a terminal on your computer and start an ssh session with the robot, see firs-time-connecting
  2. Within the terminal, enter the docker container of the Autopilot as follows: $ avular compose enter autopilot.
  3. Continue within the docker environment of the Autopilot to actually start the Autopilot in MAPPING mode by running the following command: $ ros2 launch autopilot_origin_twilight mapping.launch.py. It may take a minute or 2/3 until the Autopilot is successfully launched, at which you will receive a logging statement in the terminal that is equal to: [behaviortree_executor-1] [INFO] [autopilot.behaviortree_executor.LogInfo]: System initialized].
  4. Drive the robot in front of a known Aruco marker until the marker is also being detected by the robot. You can check whether the marker is being detected by reading the messages that are being published on a specific ROS2 topic, i.e., messages that are only being published when a marker is being detected at that moment. For that, run the following command in the docker container of the Autopilot you have just entered: $ ros2 topic echo /autopilot/marker_pose. If new messages about markers appear (with the proper ID of the marker), then the marker is being detected by the robot and you may stop acquiring the message by pressing "ctrl-c". If not, then drive the robot closer to the marker, but not closer than 0.5 meter, until the messages do appear (and then pres "ctrl-c").
  5. Open a new terminal, ssh into the robot, and enter the docker environment of the Autopilot by repeating the steps 1, 2 and 3. Within this terminal's docker environment of the Autopilot you will need to activate the localization and mapping functionality of the Autopilot by running the following two commands: $ ros2 lifecycle set /autopilot/gridslam configure that, when finished, should be followed by $ ros2 lifecycle set /autopilot/gridslam activate. Wait until the terminal returns a statement that gridslam is successfully activated and from that moment on the robot will start recording a map.
  6. Within the same environment of step 6, continue to visualize the progress of the map by starting the debug-gui as follows: $ ros2 launch debug_gui debug_gui.launch.py. The GUI is up and running when the logging statements return: [debug_gui]: received a map recording. You may then open a browser on your computer and surf to "origin-15.local:8081". The GUI starts by showing the current camera image, and by using the arrows on the left and right of the image you can forward to the third image at which you will see the recorded map at its current state. See also the image below. Please note that the GUI will display any unoccupied space as white and occupied or unknown space in black. The GUI will also show a red circle in the recorded map representing the global origin of the robot from which its position is defined.
  7. Continue with creating the map by controlling the Origin One manually until it covers the complete area. Please note to drive really slowly, especially if you are turning. High speed and drifting will negatively affect the mapping process.
  8. When you are happy with the resulting map, check whether the walls are all straight, then you may shut down the debug-gui by going the terminal at which you launched the debug-gui and press "ctrl-c". You may now also close the browser. In case you are not happy, then you may open a new terminal and enter the docker environment of the Autopilot (steps 2 and 3) and first deactivate the localization and mapping functionality by running the following command: $ ros2 lifecycle set /autopilot/gridslam deactivate. After which you may return activate that functionality again by running the following commands: $ ros2 lifecycle set /autopilot/gridslam configure that, when finished, should be followed by $ ros2 lifecycle set /autopilot/gridslam activate. This will re-initialize the localization and mapping functionality and you may create a new map by manually driving the Origin One while keeping track of the recorded map in the debug-gui.
  9. Finally, you may save the map under "some_name" by running the following command in either the second or, if applicable, the third terminal:

    $ ros2 service call /autopilot/information_manager/save_map knowledge_base_msgs/srv/SaveMap "{name: 'some_name'}"

This completes the mapping process and you may now close all the terminals you have opened during this step.

Important

Please press "ctrl-c" and wait until the process that was running in that terminal, such as the Autopilot, completely finishes before closing it.

DebugGuiRecordedMap