The user interface for remotely operating the Husky Robotics rover.
Mission Control creates a WebSocket client to connect directly to the rover WebSocket server at the URL ws://localhost:3001/mission-control
. Mission Control will automatically connect to the rover server and reconnect as needed, providing a visual indication of the connection status. Mission Control and the rover server communicate with each other by sending JSON objects termed messages over the WebSocket connection. Through these messages, Mission Control can request that the rover perform certain actions, such as drive with a specified velocity. Additionally, the rover server provides Mission Control with data such as camera streams and motor positions through these messages.
The Version of Node and NPM we are using is version 20 (latest tested version is 20.9.0)
If any build or runtime errors appear (eg. a new major version of a package comes out), TELL SOMEONE so we can address it.
- Install Node.js. You will need version 20 (The Long-Term Support (LTS) version)
- Windows and macOS: Download and run the installer for Node.js v20.x.x on your operating system (don't use the binary!)
- Linux: Run the following commands in the terminal:
sudo apt-get update
(updates package list)sudo apt-get install -y ca-certificates curl gnupg
(install neccessary packages)sudo mkdir -p /etc/apt/keyrings
(makes a directory for the keyring)curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
(gets and imports the neccesary GPG key)echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
(writes system information for the Node.js instalation)sudo apt-get update
(one last update)sudo apt-get install nodejs -y
(finally installs Node.js)
- Run
git clone https://github.com/huskyroboticsteam/mission-control.git
in your terminal to clone the Mission Control repository to your local storage. - Run
cd mission-control
to navigate into the repository. - Run
npm install
to install dependencies.
You should install and use Chromium for optimal video streaming performance. It has been tested to work on version 123. Run sudo apt install chromium
to install Chromium.
Linux users must set up a udev rule to ensure that the gamepad mappings are correct:
./linux-config/setup.sh
If you are not using the purple Xbox controllers, you may have to change the udev rule or
configure the mappings yourself with jstest-gtk
or jscal
.
- Open your terminal in the
mission-control
directory. - Run
npm run build
- Run
serve -s build
(if it says no such command, runnpm install -g serve
and retry) - Ctrl+click on the url it prints in the box
- Open your terminal in the
mission-control
directory. - Run
npm start
to start the React server. Mission Control will open in your web browser shortly.
The rover can be operated through Mission Control with either a keyboard or two gamepads. The first gamepad provides controls for driving the rover. The second gamepad provides controls for operating the rover's arm. The control bindings are detailed below.
The JSON objects sent between Mission Control and the rover server are termed messages. Each message has a type property and a number of additional parameters depending on the type. The usage of each type of message is detailed below.
Sent from the rover server to inform Mission Control of the peripheral currently mounted on the rover. This should be sent any time the rover server connects with Mission Control.
{
type: "mountedPeripheralReport",
peripheral: "arm" | null
}
peripheral
- the peripheral currently mounted on the rover, ornull
if none is mounted
Sent from Mission Control to instruct the rover to toggle the emergency stop feature.
{
type: "emergencyStopRequest",
stop: boolean
}
stop
-true
to engage the emergency stop,false
to disengage the emergency stop
Sent from Mission Control to instruct the rover server to run with a specified operation mode.
{
type: "operationModeRequest",
mode: "teleoperation" | "autonomous"
}
mode
- the requested operation mode
Sent from Mission Control to instruct the rover to orient the swerve modules in pre-determined angles (normal
: straight forward, turn-in-place
: angled to allow for turning in place, crab
: perpendicular to the rover's heading for sideways movement).
{
type: "swerveDriveModeRequest",
mode: "normal" | "turn-in-place" | "crab",
override: boolean
}
mode
- the requested drive modeoverride
-true
to ignore error thresholding when moving swerve modules,false
to respect them.
Sent from Mission Control to instruct the rover to drive with a specified straight and steer value.
{
type: "driveRequest",
straight: number,
steer: number
}
straight
- straight component in [-1.0, 1.0], where positive means drive forward and negative means drive backwardsteer
- steer component in [-1.0, 1.0], where positive means steer right and negative means steer left
Sent from Mission Control to instruct the rover to drive like a tank with a specified left and right value.
{
type: "tankDriveRequest",
left: number,
right: number
}
left
- left component in [-1.0, 1.0], where positive means drive forward on the left side and negative means drive backward on the left sideright
- right component in [-1.0, 1.0], where positive means drive forward on the right side and negative means drive backward on the right side
Sent from Mission Control to instruct the rover to turn in place with a specified steer value.
{
type: "turnInPlaceDriveRequest",
steer: number
}
steer
- steer component in [-1.0, 1.0], where positive means turn right and negative means turn left
Sent from Mission Control to instruct the rover to crab sideways
{
type: "crabDriveRequest",
crab: number,
steer: number
}
crab
- crab component in [-1.0, 1.0], where positive means to crab right and negative means to crab leftsteer
- steer component in [-1.0, 1.0], where positive means steer right and negative means steer left
Sent from Mission Control to instruct the rover to drive with holonomic capabilities (i.e., it can rotate independently without requiring translational motion).
{
type: "holonomicDriveRequest",
straight: number,
left: number,
turnCCW: number
}
straight
- straight component in [-1.0, 1.0], where positive means drive forward and negative means drive backwardleft
- left component in [-1.0, 1.0], where positive means drive left and negative means drive rightturnCCW
- turning component in [-1.0, 1.0], where positive means turning in the counterclockwise direction and negative means turning in the clockwise direction
Sent from Mission Control to instruct the rover server to make a joint move with a specified power.
{
type: "jointPowerRequest",
joint: "armBase" | "shoulder" | "elbow" | "forearm" | "wristPitch" | "wristRoll" | "hand" | "handActuator" | "drillArm" | "activeSuspension" | "ikForward" | "ikUp",
power: number
}
joint
- the name of the jointpower
- the requested power in [-1, 1]
Sent from Mission Control to instruct the rover server to make a joint move to a specified position.
{
type: "jointPositionRequest",
joint: "armBase" | "shoulder" | "elbow" | "forearm" | "wristPitch" | "wristRoll" | "hand" | "handActuator" | "drillArm" | "activeSuspension" | "ikForward" | "ikUp",
position: number
}
joint
- the name of the jointposition
- the requested position in degrees
Sent from the rover server to inform Mission Control of a joint's current position.
{
type: "jointPositionReport",
joint: "armBase" | "shoulder" | "elbow" | "forearm" | "wristPitch" | "wristRoll" | "hand" | "drillArm" | "activeSuspension",
position: number
}
joint
- the name of the jointposition
- the current position in degrees
Sent from Mission Control to instruct the rover to enable or disable inverse kinematics. This packet is not guaranteed to enable/disable IK. An armIKEnabledReport
packet will be sent immediately after the requestArmIKEnabled
is processed by the rover, and this can be used to know if IK was successfully enabled/disabled.
{
type: "requestArmIKEnabled",
enabled: boolean
}
enabled
- whether or not inverse kinematics for the arm should be enabled or disabled.
Sent from the rover to inform Mission Control whether or not the Rover has enabled or disabled inverse kinematics.
{
type: "armIKEnabledReport",
enabled: boolean
}
enabled
- whether or not inverse kinematics for the arm is enabled
Sent from the rover server to inform Mission Control of a motor's status.
{
type: "motorStatusReport",
motor: string,
power: number | null,
position: number | null,
}
motor
- the name of the motorpower
- the current power of the motor, ornull
if unavailableposition
- the current position of the motor in degrees, ornull
if unavailable
Sent from the rover to inform Mission Control of the rover's current position in the world reference frame
{
type: "roverPositionReport",
orientW: number,
orientX: number,
orientY: number,
orientZ: number,
lon: number,
lat: number,
recency: number
}
orientW
- refers to the orientation quaternion W componentorientX
- refers to the orientation quaternion X componentorientY
- refers to the orientation quaternion Y componentorientZ
- refers to the orientation quaternion Z componentlon
- refers to the longitude of the rover in world reference frame in degrees in floating point valueslat
- refers to the latitude of the rover in world reference frame in degrees in floating point valuesrecency
- refers to the difference in time between when the measurement was taken and sent in seconds
Sent from Mission Control to instruct the rover server to begin providing a camera stream.
{
type: "cameraStreamOpenRequest",
camera: string,
fps: number
}
camera
- the name of the camera:mast|hand|wrist
fps
- the frame rate of the camera stream as an integer
Sent from Mission Control to instruct the rover server to stop providing a camera stream.
{
type: "cameraStreamCloseRequest",
camera: string
}
camera
- the name of the camera:mast|hand|wrist
Sent from the rover server to inform Mission Control of a single frame of a camera stream.
{
type: "cameraStreamReport",
camera: string,
data: string | null
}
camera
- the name of the camera:mast|hand|wrist
data
- the raw h264 frame data, ornull
if no data is available
Sent from Mission Control to instruct the rover to navigate to the next waypoint. This message will only be sent if the rover is in autonomous mode.
{
type: "waypointNavRequest",
latitude: number,
longitude: number,
isApproximate: boolean,
isGate: boolean
}
latitude
- the latitude of the waypoint in degreeslongitude
- the longitude of the waypoint in degreesisApproximate
- denotes whether the location is an approximate location (See section 1.e.v URC Rules)isGate
- denotes whether the location is a gate (two posts the rover must pass between)
Sent from the rover server to inform Mission Control of the currently planned autonomous path for plan visualization.
{
type: "autonomousPlannedPathReport",
path: { x: number, y: number, heading: number }[]
}
path
- an array of points in cartesian coordinates that make up the planned path, where points with adjacent indices are connected by an edgex
- the x-coordinate of a point in meters relative to the rover's position, where positive means in front of the rover and negative means behind the rovery
- the y-coordinate of a point in meters relative to the rover's position, where positive means left of the rover and negative means right of the roverheading
- the planned heading of the rover at a point, measured in radians counterclockwise from the rover's x-axis
Sent from the rover server to inform Mission Control of an ellipse representing the 95% confidence interval for the rover's true position. This ellipse will be displayed in the Plan Viz.
{
type: "poseConfidenceReport",
radiusX: number,
radiusY: number,
rotation: number
}
radiusX
- the radius of the ellipse along the rover's x-axis before the rotation is appliedradiusY
- the radius of the ellipse along the rover's y-axis before the rotation is appliedrotation
- how many radians counterclockwise the ellipse is rotated
Sent from the rover server to inform Mission Control of data provided by the rover's lidar sensor.
{
type: "lidarReport",
points: { x: number, y: number }[]
}
points
- an array of points in cartesian coordinates read by the lidar sensorx
- the x-coordinate of a point in meters relative to the rover's position, where positive means in front of the rover and negative means behind the rovery
- the y-coordinate of a point in meters relative to the rover's position, where positive means left of the rover and negative means right of the rover