Base Component

The base component provides an API for moving all configured components attached to a mobile robot platform as a whole without needing to send commands to individual components.

If you have a mobile robot, use a base component to coordinate the motion of its motor components.

A robot comprised of a wheeled base (motors, wheels and chassis) as well as some other components. The wheels are highlighted to indicate that they are part of the concept of a 'base', while the non-base components are not highlighted. The width and circumference are required attributes when configuring a base component.

Configuration

Most mobile robots with a base use the following hardware:

  • A board
  • Some actuators to move the base, such as motors attached to wheels or propellers
  • Some sort of chassis to hold everything together.

To use a rover or other base, you need to add each component as well as the base to your machine’s configuration. Go to your machine’s CONFIGURE page, and add a model that supports your base.

The following list shows the available base models. For additional configuration information, click on the model name:

Model
Description
ModelDescription
two_wheeled_baseMobile robot with two wheels

API

The base API supports the following methods:

Method NameDescriptionviam-micro-server Support
MoveStraightMove the base in a straight line across the given distance (mm) at the given velocity (mm/sec).

SpinTurn the base in place, rotating it to the given angle (degrees) at the given angular velocity (degrees/sec).

SetPowerSet the linear and angular power of the base, represented as a percentage of max power for each direction in the range of [-1.0 to 1.0].

SetVelocitySet the linear velocity (mm/sec) and angular velocity (degrees/sec) of the base.

GetPropertiesGet the width and turning radius of the model of base in meters.

IsMovingReturns whether the base is actively moving (or attempting to move) under its own power.

StopStop the base from moving immediately.

GetGeometriesGet all the geometries associated with the base in its current configuration, in the frame of the base.

ReconfigureReconfigure this resource.

DoCommandExecute model-specific commands that are not otherwise defined by the component API.

GetResourceNameGet the ResourceName for this base with the given name.

CloseSafely shut down the resource and prevent further use.

Troubleshooting

If your base is not working as expected, follow these steps:

  1. Check your machine logs on the LOGS tab to check for errors.
  2. Review your base model’s documentation to ensure you have configured all required attributes.
  3. Review your configuration for any motors that are components of the base. Check that the names of the motor components match the list of motors you configured on the base.
  4. If a motor is spinning in an unexpected direction, try using the dir_flip attribute in its config, or try swapping the wires running to the motor to change its direction.
  5. Check that all wires are securely attached to the correct pins.
  6. If you are using a battery to power the base, check that it is adequately charged. If the motors are drawing more power than the battery can supply, the single-board computer may be power cycling. Consider using a wall power supply for testing purposes to rule out this issue.
  7. Click on the TEST panel on the CONFIGURE or CONTROL tab and test if you can use the base there.

If none of these steps work, reach out to us on the Community Discord and we will be happy to help.

Next steps

For general configuration, development, and usage info, see:

You can also use the base component with the following services: