Get the geometries of the component in their current configuration
const base = new VIAM.BaseClient(machine, 'my_base');
const geometries = await base.getGeometries();
For more information, see Base API.
Readonly
nameThe name of the resource.
Return the base's properties.
Optional
extra: Structconst base = new VIAM.BaseClient(machine, 'my_base');
const properties = await base.getProperties();
For more information, see Base API.
Return true if the base is in motion.
const base = new VIAM.BaseClient(machine, 'my_base');
const moving = await base.isMoving();
For more information, see Base API.
Move a base in a straight line by a given distance at a given speed. This method blocks until completed or cancelled.
Distance to move, in millimeters.
Movement speed, in millimeters per second.
Optional
extra: Structconst base = new VIAM.BaseClient(machine, 'my_base');
// Move forward 40mm at 90mm/s
await base.moveStraight(40, 90);
// Move backward 40mm at -90mm/s (backwards)
await base.moveStraight(40, -90);
For more information, see Base API.
Set the linear and angular power of a base from -1 to 1 in terms of power for each direction.
Desired linear power percentage from -1 to 1.
Desired angular power percentage from -1 to 1.
Optional
extra: Structconst base = new VIAM.BaseClient(machine, 'my_base');
// Move forward at 75% power
await base.setPower(
{ x: 0, y: 0.75, z: 0 }, // linear power
{ x: 0, y: 0, z: 0 } // no rotation
);
// Move straight back at 100% power
await base.setPower(
{ x: 0, y: -1, z: 0 }, // linear power
{ x: 0, y: 0, z: 0 } // no rotation
);
// Turn counter-clockwise at 50% power
await base.setPower(
{ x: 0, y: 0, z: 0 }, // no linear movement
{ x: 0, y: 0, z: 0.5 } // rotate around z-axis
);
// Turn clockwise at 60% power
await base.setPower(
{ x: 0, y: 0, z: 0 }, // no linear movement
{ x: 0, y: 0, z: -0.6 } // rotate around z-axis
);
For more information, see Base API.
Set the linear and angular velocity of a base.
Desired linear velocity in millimeters per second.
Desired angular velocity in degrees per second.
Optional
extra: Structconst base = new VIAM.BaseClient(machine, 'my_base');
// Move forward at 50mm/s while spinning 15 degrees per second to the left
await base.setVelocity(
{ x: 0, y: 50, z: 0 }, // linear velocity in mm/s
{ x: 0, y: 0, z: 15 } // 15 degrees per second counter-clockwise
);
For more information, see Base API.
Spin a base by a given angle at a given angular speed. This method blocks until completed or cancelled.
Degrees to spin.
Angular speed, in degrees per second.
Optional
extra: Structconst base = new VIAM.BaseClient(machine, 'my_base');
// Spin 10 degrees clockwise at 15 degrees per second
await base.spin(10, 15);
// Spin 180 degrees counter-clockwise at 20 degrees per second
await base.spin(-180, 20);
For more information, see Base API.
Represents a physical base of a robot.