Step 3.2: Basic Configuration (Environment, Firmware Installation, xESC configuration)

Configure the environment, install firmware to the xCore board and configure your xESC motor controllers.

Overview:

Types of settings

There are two parts to the robot configuration:

  • Environment Variables: tell the system which mower model and hardware version you are using as well as which version of the ROS to use. We will need to configure these first.
  • ROS Parameters: Configure the ROS runtime behavior. This includes GPS settings, mowing behavior, MQTT configuration for smart-home, etc.

The openmower command line tool

We have created the openmower command line tool which helps you with all tasks related to running, configuring and debugging the OpenMower software stack.

The openmower tool is preinstalled on the OpenMowerOS and has the following features (and more):

  • Edit ROS and Environment configuration files
  • Install / Update Firmware on the xCore board
  • Start / Stop the ROS software
  • Show ROS logs
  • Enter a ROS shell for debugging

Accessing the terminal

You will need access to the terminal for all of the following steps. You can either use SSH or the browser-based terminal.

SSH can be reached using the following credentials:

username: openmower
hostname: openmower
password: openmower

The browser based terminal does not need any credentials and can be reached at: http://openmower:7681

Step 3.2.0: Basic Checks

Check, if filesystem expanded correctly

If your filesystem is almost full, do the following steps to properly expand the filesystem:

  • Run sudo raspi-config
  • Select Advanced Options -> Expand Filesystem
  • Finish and Reboot
  • Run df -h / again, you should see the Use % column is now down to a low percentage (depending on your SD card size)

Update the openmower tool to the latest version

To make sure you have the latest version of the openmower tool, you need to update it to the latest version. The tool has an integrated update mechanism, so to update, you need to run:

sudo openmower update-self

Here is the expected output:

Example output for a successful update.

Rename your host (optional)

If you are running multiple robots, it’s a good idea to rename your host to distinguish between them.

You can do this by following the steps in the Knowledge Base: Change Hostname

Enable External WiFi Antenna (optional)

If you have added an external WiFi antenna, you need to enable it. You can do this by following the steps in the Knowledge Base: Enable External Antenna

Step 3.2.1: Setup Environment Variables

Now we can start the configuration by setting the environment variables.

  • Start the configuration by running openmower configure env
  • Select your favorite editor (e.g. nano)
  • Edit the environment variables, the comments tell you what to do
  • Save the file (Ctrl + O, Enter to save followed by Ctrl + X, Enter to exit nano)

Here is a screncast showing the whole process:

In the example a YardForce Classic 500 with v2 Hardware was used.

After this is done, the system will know which ROS version to use and which mower model is used.

The openmower tool will now fetch the selected ROS version. This will take some time (~30 minutes). Time to get some ☕.

Step 3.3.1: Install Firmware

Now that the system knows which hardware you are using, we are ready to install the firmware to the xCore board.

To install the firmware to the xCore board, simply run: openmower update-firmware. The openmower tool will read your environment variables, download the appropriate firmware binary and upload it to the xCore board via Ethernet.

The expected output is shown below:

Example output for openmower update-firmware command.

Step 3.3.2: Configure xESC Motor Controllers

The xESC motor controllers can be configured to work with many BLDC and DC motors. The firmware for the controllers is based on the open source VESC project and therefore, the controllers can be configured using the VESC Configuration Tool.

Prerequisites

  • Windows or Linux computer to run the VESC Configuration Tool
  • VESC Tool (https://vesc-project.com/vesc_tool) You can download the tool for free by adding the “free” version in your cart and proceeding to checkout.
  • OpenMower Firmware needs to be successfully installed in the xCore board. This is needed because the xCore bridges the connection between your computer and the xESC. If you haven’t done it, follow the Firmware Update guide.
  • Optional (but makes your life easier):
    Configuration files for the mower you are using.
    Look in the OpenMower repository for the files suited for your mower.
    You will need three files:
    • App configuration XML (sets the baud rate, etc. Same for all three xESC controllers)
    • Mower Motor configuration XML (motor parameters for the mower motor)
    • Drive Motor configuration XML (motor parameters for the wheel motors)

Configuration Process

Stop ROS from interfering with the controllers

openmower stop to stop ROS from interfering with the controllers during configuration.

Expose the ESC to the network

Expose ESC to the network Run openmower expose-esc [left|right|mower] to expose the xESC controller (choose left, mower or right).
The controller is then reachable in your local network on openmower:65102 until you hit Ctrl + C.

Connect to the xESC

Connect VESC tool to ESC Open the VESC Configuration Tool and connect to the xESC controllers by clicking:

  • Connection -> TCP [1]
  • Insert the IP address of your mower or openmower into the Address field [2].
  • Set the port to 65102 [3]
  • Click Connect [4]

Upload the configurations

With the VESC Configuration Tool connected, you can now upload the configuration to your xESC controllers:

  • [Image 1]: Click File -> Load Motor Configuration XML
  • [Image 2]: Select the motor configuration XML file for your motor (different for mowing motor and the drive motors)
  • [Image 3]: Ignore the version message, if it appears
  • [Image 4]: Click Write Motor configuration. The green banner will appear on success.
  • [Image 5]: Click File -> Load App Configuration XML. Ignore the version message, if it appears
  • [Image 6]: Click Write App configuration. The green banner will appear on success.
  • Hit Ctrl + C in the openmower terminal to stop exposing the xESC controller.

Repeat these steps for all three of the three xESC controllers.

Continue with Step 3.4: Configure ROS Parameters