Skip to content

Getting started

RuslanBredun edited this page Aug 7, 2024 · 5 revisions

OpenAMR project

Getting started

This document is a comprehensive guide for setting up the openAMR platform, an innovative mobile platform for various purposes. Based on the Linorobot, this guide walks users through the installation process.

Install SoftWare

1. Install Ubuntu 20.04

Preparation:

2. Install Software

Preparation:

  • Ensure you have an internet connection on both computers.

2.1 Install rosme repository

  1. Open a terminal window on both computers (robot's computer and development computer).

Run the following commands on both computers:

    sudo apt update

    sudo apt install git python3-pip

This updates the package lists and installs Git and Python's package manager pip.

Clone the rosme repository and install it

    git clone https://github.com/linorobot/rosme

    cd rosme

    ./install

This downloads the rosme repository and runs its installation script.

2.2 Install Robot Packages and Repositories (!WARNING! some libraries in the Linorobot project may be deprecated. We will fix them in the next release)

Robot's computer:

Switch to your home directory:

    cd

Clone the lino_install repository and navigate to it:

    git clone https://github.com/linorobot/lino_install

    cd lino_install

Run the installation script, with specific params for openAMR (2wd rplidar):

    ./install 2wd rplidar

This script downloads and installs the necessary ROS packages and dependencies for your robot's configuration.

Development computer:

Navigate to your catkin workspace's src directory (replace ~/catkin_ws/src with the actual path):

    cd ~/catkin_ws/src

Clone the required ROS packages for development:

    git clone https://github.com/linorobot/lino_pid.git

    git clone https://github.com/linorobot/lino_msgs.git

    git clone https://github.com/linorobot/lino_visualize.git

Install the ros-$(rosversion -d)-teleop-twist-keyboard package to enable teleoperation using the keyboard:

    sudo apt-get install ros-$(rosversion -d)-teleop-twist-keyboard

Build the catkin workspace:

    cd .. && catkin_make

This compiles the downloaded ROS packages.

2.3 Network setup

On both the robot's computer and development computer, run the following command to get the current network details (IP addresses):

    ifconfig

Note down the IP addresses for both computers.

  1. Robot's Computer:

Open or edit the .bashrc file in your home directory using a text editor like nano:

    nano ~/.bashrc

Add the following lines (replace with the actual IP address of your robot):

    export ROS_MASTER_URI=http://<robot-ip>:11311

    export ROS_HOSTNAME=<robot-ip>
  • These lines set the ROS master URI and hostname for the robot's computer.

  • Save the changes and close the editor (Ctrl+O, then Ctrl+X).

  1. Development computer:

Repeat the steps above to edit the .bashrc file.

Add the following lines (replace with the robot's IP address and with the development computer's IP address)

    export ROS_MASTER_URI=http://<robot-ip>:11311
    
    export ROS_HOSTNAME=<devcom-ip>
  • These lines set the ROS master URI and hostname for the development computer.

  • Save the changes and close the editor (Ctrl+O, then Ctrl+X).

Important:

Source the .bashrc file on both computers to apply the environment variables:

    source ~/.bashrc

2.4 udev rules

Purpose:

  • Create udev rules to automatically recognize the robot's hardware (base and lidar) when connected to the computer.

Steps: (!WARNING! some libraries in the Linorobot project may be deprecated. We will fix them in the next release)**

Run the following command on the robot's computer to generate the udev rules:

    rosrun lino_udev lino_udev.py

Copy the generated udev rules to the system-wide rules directory:

    sudo cp 58-lino.rules /etc/udev/rules.d/58-lino.rules

Reload and restart the udev service:

    sudo service udev reload

    sudo service udev restart

Check if the devices are recognized:

    ls /dev/base

    ls /dev/lidar

You should see the corresponding device files if the rules are applied correctly.

Clone this wiki locally