arrow-left

All pages
gitbookPowered by GitBook
1 of 5

Loading...

Loading...

Loading...

Loading...

Loading...

minirover

MiniRover is our modification of the GoPiGo3 robot. It comes with software, a VPN and all kinds of fancy things which is why I decided to give it a special name. This page is under construction as I troubleshoot and make notes about things. I expect feedback from everyone where the instructions don't meet reality!

mrbuild.md

hashtag
GoPiGo3 Basic Kit

We recommend that you start with a GoPiGo3 Basic Kitarrow-up-right. Build it following the instructions. There is a lot written and a lot to google about it. Here are some useful links:

  • Dexter Forumarrow-up-right - where you can get many questions answered

  • - where you find step by step instructions.

  • - instructions for students taking Cosi119a at Brandeis University to order a miniRover.

In addition to what you received with the Basic Kit you will need the following to get through the instructions.

  • A Raspberry Pi 3+

  • A battery pack (with Y-cable and charger)

  • A MicroSD card

The Battery pack is different from what the instructions talk about. The Y-Cable is used to connect the barrel connector of the battery pack with the corresponding battery connector on the "Red Board" which in turn will power the Raspberry Pi.

The robot will come with a microSD card with the dexter software. There is some very very simple calibration that you need to do.

hashtag
Battery Pack

  • The battery pack is specific in terms of voltage and capacity. Don't substitute it for another one.

  • Note that the battery pack needs to be in the "on" position in order to have the charger do anything. And obviously it has to be in "ON" for the robot to work.

  • It also comes with a charger and a y-cable. The y-cable is about 10" long and has three barrel connectors on it in a y-configuration.

hashtag
Camera

You will have bought the camera separately, but the instructions talk about how to mount it to the robot. Make sure it is centered in all three dimensions. A good spot is on the front of the top plexiglass part. It can be do without any extra parts, but which works nicely too.

hashtag
Lidar

The Lidar needs to be mounted on the top plexiglass part. You will need to drill two holes. Make sure that the Lidar is exactly centered and pointed forward. As far as the drilling: I kept it to a minimum and drilled only two. I think it doesn't matter much. Mostly that it be straight and centered. Note that the narrower part of the Lidar is the front. You want it centered and facing forward (which on the other side of the ball caster.) I drilled holes for the two posts at the back of the Lidar (the wider part.) I don't see that it matters much though, that was what was easiest for me.

A Lidar
  • A very short USB cable

  • We use only two of the 3 ends of the Y-connector. One goes into the barrel connector on the red board, and one goes into the barrel connector on the battery pack.

  • We then connect the very short usb cable with one end in the battery pack and the other end in the "power" connection of the Lidar board. The Lidar board is tiny about 1.5" square. On the one side you have the funny Lidar wires and on the other side you have two micro usb connectors. If you look very carefully one is marked data and one is marked power. The one marked data is connected with a short usb cable to one of the usb connectors of the pi. The one marked power is connected with another short usb cable to the battery pack.

  • Build your GoPiGo3arrow-up-right
    MiniRover Purchase Programarrow-up-right
    Dexter has this bracketarrow-up-right
    Top View of MiniRover
    Side View of MiniRover

    mrsetup.md

    This section will help you get your robot set up to go. Note that if you received this from the Autonomous Robotics Lab then part of these steps may already be done.

    See the important information about turning the robot on and off here: Using the Robot.

    hashtag
    MicroSD Card (if needed)

    If your robot was set up by us, then you should skip this step!

    You are going to load software onto the microSD Card - which will wipe out what you loaded onto it according the the instructions before. We provide you a disk image on which to store it. It changes from time to time. is to a google folder that will contain the versions. You should use the latest one in that folder. I recommend you use the app "Balena Etcher" to copy the image onto your microSD card.

    To create a new MicroSD from the old one, see

    hashtag
    Connecting to the network

    Now we are facing a dilemma. We need to get the robot on your network. There are several ways of doing this. Below are two specific scenarios that we support:

    1. A usb keyboard, usb mouse and a HDMI display and eduroam wifi access

    2. OR A network cable and non-eduroam wifi access

    3. A MiniRover v2 and non-eduroam wifi access. It should be labeled with a name.

    hashtag
    Scenario 1

    1. We will tell you what the name of your robot is. Plug it in below wherever you see gopigo3

    2. Locate a wired network connection (on your router for example) and use a network cable to connect your robot to the network

    3. Now turn the power on (see for instructions. It should boot up into linux. But you won't know this because there's no keyboard or screen!

    Once this works you know that you have access to the robot from your remote computer. Make note of the robot' ip address. It will likely look like 192.168.1.xx but not necessarily.

    1. Now use ssh (secure shell) to get to the robot from the remote:

    It will ask you for the password for account pi. It is raspberry. Once you get in you are 1/2 way there!

    1. Now we want to get your robot onto your local wifi network. You need to know the wifi network's name and password. On the robot command line type:

    Where <SSID> is the network's name. You can surround it in quotes if there are spaces or other funny characters. is the password.

    1. Next shutdown the robot nicely (see above), disconnect the network cable, and start the robot up nicely again (see above.)

    2. Once it's back, follow the same steps to ssh pi@gopigo3.local and enter the password raspberry and you should have a wireless enabled robot.

    hashtag
    Scenario 2

    1. Connect your mouse, keyboard and screen to the Raspberry pi. You will find several free USB ports and an HDMI port. Look closely they are all there.

    2. Boot up the Raspberry Pi and wait until it is running and you see the desktop

    3. Locate the network settings dialog box by clicking the network icon on the top right

    1. Finally shutdown the robot, unplug the keyboard, mouse and monitor and reboot

    2. Once it's back ssh pi@gopigo3.local and enter the password raspberry and you should have a wireless enabled robot

    hashtag
    Scenario 3 incomplete and incorrect

    You've received a fully set up and tested Minrover v2, and you know the name. The following steps are written as if the robot is called mr1. Scenario 3 Robots will have the account ubuntu with the password ubuntu (so different from scenario 1 and 2)

    1. Now turn the power on (see for instructions. It should boot up into linux. But you won't know this because there's no keyboard or screen!

    2. MiniRover will come up as a Wifi access point. The SSID is mr1XXXX where XXXX is part of the MAC address. The wifi password is robotseverywhere.s Connect to it via your computer's wifi.

    hashtag
    Troubleshooting ssh gopigo3.local

    Under certain circumstances gopigo3.local will be found. If so you need to find out the ip address of your robot when it is on wifi (not wired). If then this should work:

    hashtag
    Updating the hostname of your Robot

    Rename the hostname of your robot. It comes to you called "gopigo3" but they are all called that and this can cause confusion. Let's say you want to call your robot pitosalas. Oddly you have to change it in two places. Here's how"

    Now the robot is called pitosalas and at least it will be different from other miniRovers.

    hashtag
    Eduroam

    On eduroam it is often automatically known as gopigo3.dyn.brandeis.edu. So after rebooting it check if this works. It's not guaranteed but often it works just fine.

    hashtag
    VPN

    You can run everything on the robot itself but it doesn't have a screen. You could plug an external screen, keyboard and mouse and have a complete ROS enabled computer (the robot) at your finger-tips. But it would be real slow. So instead we are going to add the robot to a "VPN" - virtual private network which will allow you to work with it remotely.

    1. Prepare the VPM configuration by:

    1. Setup VPN

    1. myvpnip should now return that same IP address.

    hashtag
    Updates for your Robot

    We have installed some Brandeis specific software which should be updated:

    And then edit the new ~/.bashrc according to the instructions in the file.

    hashtag
    Updates to your Cloud Desktop

    1. Check that you have ~/rosutils directory on your cloud desktop. If not:

    Edit .bashrc according to the instructions in it

    hashtag
    This will continue to be updated

    mrtroubleshooting.md

    Author: Pito Salas

    hashtag
    Gemeral

    • An excellent and very detailed troubleshooting guide for the Raspberry Piarrow-up-right

    hashtag
    LED on the Red Board

    • Blinking green is the “starting up” indication.

    • Solid green is the “ready” indication.*

    • Solid yellow is the “low battery” caution indication.

    But, note that all of these indications are only valid when using a Dexter Industries / Modular Robotics operating system. (i.e. Raspbian for Robots, GoPiGo OS, or Dexter OS). It will continue to blink green when using any other O/S. The Minirover configuration is Ubuntu! Also see: https://www.dexterindustries.com/GoPiGo/get-started-with-the-gopigo3-raspberry-pi-robot/2-connect-to-the-gopigo-3/

    hashtag
    Python default

    To Change the default python on ubuntu (assuming you want it to be python3.4)

    sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.4 1

    hashtag
    Check whether spi is working on the pi

    Solid red is the “low battery” warning.
  • Blinking red is the “shutting down” indication.

  • Blinking purple is (AFAIK) the “I don’t know what is going on” indication, but I could be wrong.

  • >>> import spidev
    >>> spi = spidev.SpiDev()
    >>> spi.open(0,1)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    PermissionError: [Errno 13] Permission denied

    Using your own computer or development environment that is attached to the network check that you see the robot. This includes a linux computer where you program, or a browser web development environment. Broadly speaking, it's the computer "other than" to raspberry pi on the robot (we will refer to this as the remote computer from now on).

    Add eduroam as a network, and fill it in as follows:

    This linkarrow-up-right
    Backup Raspi Card on MacOSarrow-up-right
    Using MiniRover
    Using MiniRover
    Button to reboot
    ping gopigo3.local
    ssh pi@gopigo3.local
    sudo nmcli d wifi connect <SSID> password <password>
    ssh pi@<ip address>
    # In the shell of the robot:
    sudo hostname pitosalas
    
    # In the hostname file:
    sudo nano /etc/hostname
    sudo apt-get remove -y tailscale
    sudo rm -rf /var/lib/tailscale/tailscaled.state
    
    # Reboot right after!
    sudo reboot
    # Get the tskey from Pito
    cd ~/rosutils
    chmod +x pi_connect.sh
    
    # Run the script with the tailscale authkey
    sudo ./pi_connect.sh <tskey-123abc456>
    
    # On successful connect, you should see this
    # Connected. IP address: 100.xx.xxx.xxx
    cd ~/rosutils
    git pull
    cp ~/rosutils/bashrc_template.bash ~/.bashrc
    cd ~/catkin_ws/src/gpg_bran4
    git pull
    cd
    git clone https://github.com/campusrover/rosutils.git
    cp rosutils/bashrc_template.bash .bashrc

    mruse.md

    hashtag
    Turning it on

    It is important that you follow a rigid procedure when turning the robot on and off.

    Assuming it is totally off:

    1. Make sure the battery pack is correctly connected to the robot.

    2. Switch on the battery pack

    3. Click the micro button on the red board

    1. Look at the Raspberry Pi (not the "red board") You will see tiny red and green LEDs blinking. Wait until the green one has settled down to slow flickering.

    hashtag
    Turning it off

    1. From your ssh command line on the remote computer, type sudo shutdown now

    2. Once the Raspberry Pi has stopped blinking you can turn off the power switch on the battery pack.

    hashtag
    Charging the Battery

    The Battery pack came with a charger. It has a light on which is red while charging and green when fully charged. Note that the battery will not charge when its switch is set to off.

    hashtag
    rset command

    We've implemented a very simple tool to set up the IP addresses correctly. It will be changing as I figure out how to make it better. So for now...

    1. If you have a cloud desktop and want to run simulations without a actual miniRover" rset cloud

    2. If you have a cloud desktop add a real robot, run rset robot on your cloud desktop and rset pi on the actual miniRover (over ssh)

    rset by itself displays the current status

    (I know a combination is missing and plan a revision of this)

    hashtag
    Starting the MiniRover ROS applications

    Note that all we run on the MiniRover itself are roscore, and the nodes needed for the motors, lidar and camera. Everything else runs on your "remote". The following commands are to be done on the MiniRover from ~/catkin_ws

    hashtag
    Web Desktop tools

    Note that this includes all flavors, cloud based, local docker based, and gpu based browser desktops. If you just want to use the simulators on their own and are not using an actual miniRover, then: rset cloud is enough. At that point you can run your ROS programs.

    There are numerous scripts, programs and launch files that are preinstalled on your ROS wegpgb desktop. I will document only some of them here but you can look around and find more that are interesting. All of them from the book are here. I have not renamed any of them for that reason.

    hashtag
    Rset Command

    In order to facilitate working in all the combinations of environments we have these commands:

    • rset pi - declare that this is the raspberry pi

    • rset cloud - declare that this is a cloud desktop working with sim

    • rset robot - declare that this is a cloud desktop working with a real robot

    hashtag
    Aliases

    There are a bunch of handy aliases:

    • myip - this computer's regular local ip

    • myvpnip - this computer's vpn ip if it has one

    • stopnow

    hashtag
    Accounts and passwords

    • miniRover

      • hostname gopigo3

      • default account pi

    hashtag
    Key Environment Variables

    ROS_MASTER_URI=http:/100.94.206.80:11311 (example!) should always be set to the computer where roscore is running. If you are using a physical robot, then roscore runs on the robot itself. If you are in the web deskop and working just with simulation then roscore would run there.

    hashtag
    Robot

    ROS_MASTER_URI = robot's own ip address ROS_IP = robot's own ip address

    hashtag
    Remote Computer

    ROS_MASTER_URI = robots ip address ROS_IP = remote computer's own IP address

    These IP addresses are on different networks and cannot access each other. So instead we've created what is called a "virtual private network" that connects them together. Both your robot and your cloud desktop have an alternate ip address which they can both see.

    hashtag
    IP Addresseses

    • myip returns your local ip address

    • myvpnip returns your vpn ip address (if you have one)

    If you have a local docker based desktop, run rset docker there.
    rset - display settings
    - immediately stop the robot
  • teleop - run a simple teleop tool

  • ru - connect to rosutils

  • cm - catkin_make

  • cw - cd ~/catkin_ws

  • cs - cd ~/catkin_ws/src

  • default password raspberry

  • Cloud or Docker Desktop

    • default password dev@ros

    • desktop: url: http://vnc..ros.campusrover.org

    • vscode: http://code..ros.campusrover.org

  • Button to reboot
    # launch the motor controller and lidar
    roslaunch minirover mr_bringup.launch
    
    # launch camera (optional if you need the camera)
    roslaunch gpg_bran raspicam.launch
    # Fun prr examples
    rosrun prrexamples red_light_green_light.py
    rosrun prrexamples wander.py
    
    # Visualize robot with rviz
    roslaunch gopigo3_navigation gopigo3_rviz.launch 
    
    # Or with gazebo (not as useful)
    roslaunch gopigo3_navigation gopigo3_gazebo.launch 
    
    # Run different simulated stages to experiment with roslaunch 
    roslaunch turtlebot3_gazebo turtlebot3_stage_1.launch
    roslaunch turtlebot3_gazebo turtlebot3_stage_2.launch
    roslaunch turtlebot3_gazebo turtlebot3_stage_3.launch
    roslaunch turtlebot3_gazebo turtlebot3_stage_4.launch
    
    # Control the robot
    roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
    
    # Begin building the map on real robot
    roslaunch gopigo3_navigation gopigo3_slam.launch
    
    # Begin localization with AMCL
    roslaunch gopigo3_navigation amcl.launch