G1

Estimated reading: 6 minutes 64 views

Quick Start

Power On

Charge

Emergency Button

Drive

Network Map


Navigation and Mapping

To run the Mapping, Navigation and the Waypoint Server, please download the G1 repository in your ros2 workspace first. (see how to create a ros2 workspace)

SSH Access

The computer of the robot can be accessed over ssh.

  1. Connect to the WIFI router of the robot: SSID: olixLink-C1 PW: olixLink
  2. ssh with following command: ssh olive@192.168.7.200. PW: one

Mapping / SLAM

The SLAM part is done in three steps

  1. Visualization
  2. Mapping
  3. Saving the Map
Visualization

To visualize the mapping process rviz2 is used:

  1. To visualize the mapping process there is a rviz2 file called g1_slam.rviz in the G1 repository
  2. Run following command in your host system: ros2 run rviz2 rviz2 -d path_to_rviz2_file
Mapping
  1. SSH into the robot
  2. Run the slam.sh script under the scripts directory. This stars the mapping.
  3. Now you should see a map, when driving with the robot the map should be updated
Saving the Map
  1. SSH into the robot
  2. Run following command to save the map: ros2 run nav2_map_server map_saver_cli -f map
    This will save a map.pgm and a map.yaml file.
    Behind the -f flag you can also add a path e.g. /home/maps/first_map
  3. Now you map is saved and can be used for navigation

Navigation

The Navigation part is done in four steps:

  1. Run Navigation
  2. Visualization
  3. Initialize a Position
  4. Send a Position
Navigation
  1. SSH into the robot
  2. Run the navigation.sh --map map.yaml script under the scripts directory. This stars the navigation.
    --map: Path to the previous created map (is has to be the *.yaml file)
  3. Please check the map is loaded in rviz2 (maybe restart rviz2)
Visualization

To visualize the navigation process rviz2 is used (it should be run after the navigation is started):

  1. To visualize the navigation process there is a rviz2 file called g1_navigation.rviz in the G1 repository
  2. Run following command in your host system: ros2 run rviz2 rviz2 -d path_to_rviz2_file
Initialize a Position
  1. To initialize a position open rviz2 and go to 2D Pose Estimate. And place the robot roughly where the robot is located in the map
  2. Turn the robot manually 3 to 4 times by himself, so that amcl is adjusting the robots position. You should see it in rviz2, that he is adjusting his position (lasers are align to the wall)
Navigate to a Position
Via Rviz
  1. Now you can send a goal via Nav2 Goal in rviz2
  2. You should see a planned path which is then driven by the robot (Please be sure that the controller is not actively in use (robot light are blue), if yes, press the RT or LT Button to deactivate the controller).
Via CLI

To send a goal via cli or api an action server called /navigate_to_pose is available.
Example:

ros2 action send_goal /navigate_to_pose nav2_msgs/action/NavigateToPose "pose:
  header:
    stamp:
      sec: 0
      nanosec: 0
    frame_id: 'map'
  pose:
    position:
      x: 1.0
      y: 0.0
      z: 0.0
    orientation:
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0
behavior_tree: '' "

Waypoint Server

With the Waypoint server it is possible to save a point on the map and let the robot moves to these points via a ros2 service call.

Available ROS 2 ServiceDescription
list_waypointsList all available waypoints
save_waypointSave the current robot position as waypoint
save_waypoint_poseSave a given pose as waypoint
delete_waypointDelete a waypoint
move_to_waypointDrive to a waypoint, by the waypoint name

Setup

The waypoint server runs on the robot itself, but on the host system the interfaces/msgs are necessary, so that it`s possible to send some services.

# 1. Clone the G1 Respository
git clone https://github.com/olive-robotics/olvx_g1

# 2. Create a ros2 workspace
mkdir -p ~/ros2_ws/src

# 3. Copy the waypoint_server_interfaces into ros2 workspace src
cp -r waypoint_server_interfaces ~/ros2_ws/src 

# 4. Go into the ros2 workspace
cd ~/ros2_ws

# 5. Build the package
colcon build --symlink-install --packages-select waypoint_server_interfaces

# 6. Source your workspace
source install/setup.bash

# 7. To source it permanent add the source into .bashrc
source $HOME/ros2_ws/install/setup.bash >> ~/.bashrc

Getting Started

  1. Run the navigation script from above, this will also start the waypoint server

List all Waypoints

You can list all waypoint with following command:

ros2 service call /waypoint_server/list_waypoints waypoint_server_interfaces/srv/ListWaypoints {}\ 

Save a Waypoint

You can save a waypoint in two ways:

  1. Manual via cli
  2. Current robot base as waypoint
Manual

To save the via cli run following command, the pose is set in the map frame:

ros2 service call /waypoint_server/save_waypoint_pose waypoint_server_interfaces/srv/SaveWaypointPose "name: 'wp_1'
pose:
  position:
    x: 2.0
    y: 0.0
    z: 0.0
  orientation:
    x: 0.0
    y: 0.0
    z: 0.0
    w: 1.0" 
Save current robot base as waypoint
ros2 service call /waypoint_server/save_waypoint waypoint_server_interfaces/srv/SaveWaypoint "name: 'wp_1'"

Delete a Waypoint

To delete a waypoint you can run following command

ros2 service call /waypoint_server/delete_waypoint waypoint_server_interfaces/srv/DeleteWaypoint "name: 'wp_1'"

Drive to a Waypoint

You can drive to a saved waypoint with following command:

ros2 service call /waypoint_server/move_to_waypoint waypoint_server_interfaces/srv/MoveToWaypoint "name: 'wp_1'" 

Troubleshooting

Laser not available or waiting for laser_scans

If the Laser is not available, of the command journalctl -u g1_startup -f spams Waiting for laser_scans or
when starting slam or navigation is not working. Try to restart the mini-pc otherwise you can try to restart the bot.

Process killed by OMM Killer

It can happen that the OMM Killer killed the navigation or slam process. If this happens follow these steps:

  1. Kill als ros2 nodes running on your host system (also ros2 daemon with ros2 daemon stop)
  2. Remove shm files
    sudo rm -rf /dev/shm/fast* /dev/shm/fastrtps* /dev/shm/rtps_*
  3. Restart Computer
Map Saver: Failed to spin map subscription

When saving the map there could be an error like:

This happens sometimes, retry to save the map until it works.

3D SLAM FAST LIO

The Fast Lio SLAM uses an IMU and a 3D Lidar and creates a 3D Map out of it.

Run the Livox Lidar

  1. Build the livox lidar following these instructions
  2. Connect to the Livox Lidar via LAN and setup your host system with the IP Address 192.168.9.200 and MAC-Address 255.255.255.0.
  3. Replace the MID360.json file in the /livox_ws/src/livox_ros_driver2/config with this content
  4. Rebuild the livox lidar package
  5. Run the following command: ros2 launch livox_ros_driver2 msg_MID360_launch.py
    Hint: If you only want to run the livox lidar without fast lio for ros2 run following command: ros2 launch livox_ros_driver2 rviz_MID360_launch.py. Then it is in the ros2 pointcloud message

Run FAST LIO

  1. Build Fast Lio following these instructions
  2. Source the workspace of the livox_lidar and the fast lio
  3. Run Fast LIO with following command: ros2 launch fast_lio mapping.launch.py config_file:=mid360.yaml
    Hint: Do not run this via ssh, otherwise it will not work. It needs a display

Share this Doc

G1

Or copy link

CONTENTS