Input

Documentation for each input module in the main NUbots codebase
Updated 25 Aug 2024

Camera

Description

Reads Cameras: Which are GigE Vision or U3V (Usb3 Vision, via USB3 Cable).

Usage

Settings are defined in the config/Cameras

Emits

message::input::Image

Dependencies

Aravis

FakeCamera

Description

Loads compressed images (JPEGs) and corresponding lens parameters (YAML files) from the specified folder and emits them as CompressedImage messages

Images are and lens files are expected to be named using a common theme (e.g. image000001.jpg and lens000001.yaml).

Usage

In the config file set image_folder to be the path to the folder containing the image and lens files, image_prefix to the portion of the filename that is common to all image files and lens_prefix to the portion of the filename that is common to all lens files.

image_folder: 'images'
image_prefix: 'image'
lens_prefix: 'lens'

All images are assumed to be JPEGs with either a .jpg or .jpeg extension. All lens files are assumed to be YAML files with a .yaml extension.

Lens files should contain the following information

projection: EQUISOLID # Either RECTILINEAR, EQUIDUSTANT, or EQUISOLID
focal_length: 420 # Un-normalised focal length in pixels
centre: [0, 0] # Distance between the camera centre axis and optical axis in pixels (measured from the centre of the image)
k: [0, 0] # Distortion coefficients
fov: 1.59286 # Field of view in radians
Hoc: # Camera to observation plane (world) homogeneous transformation
- [-0.308872, 0.945477, 0.103304, 0]
- [-0.84664, -0.223831, -0.482805, 0]
- [-0.433359, -0.236586, 0.869613, 0.9]
- [0, 0, 0, 1]

Emits

message::output::CompressedImage with a JPEG FOURCC code

Dependencies

Eigen libjpeg-turbo

ImageDecompressor

Description

Decompresses images that are in JPEG format to raw images, using a variety of decompressors. It will use decompressors in order until it finds a free one to compress the image. In the event that no compressors are currently free it will drop the image.

Usage

Triggers on message::output::CompressedImage Configuration from ImageDecompressor.yaml

Emits

message::input::Image

Dependencies

TurboJPEG

Sensor Filter

Description

Uses a Unscented Kalman filter to filter the raw incoming data, and provide clean platform agnostic data.

We assume that the IMU (accelerometer and gyroscope) are oriented to conform with the standard coordinate system x-axis out the front of the robot y-axis to the left z-axis up

For the accelerometer the orientation should be as follows x axis reports a +1g acceleration when robot is laying on its back y axis reports a +1g acceleration when robot is laying on its right side z axis reports a +1g acceleration when robot is vertical

Usage

When installed, it will read incoming message::platform::RawSensors objects and pass them through the kalman filter. The resulting filtered data will then be outputted as message::input::Sensors to be used by the rest of the system.

Consumes

  • message::platform::RawSensors in order to filter them.

Emits

  • message::input::Sensors with filtered data from the input.
  • message::input::ButtonLeftDown when button pressed.
  • message::input::ButtonLeftUp when button released.
  • message::input::ButtonMiddleDown when button pressed.
  • message::input::ButtonMiddleUp when button released.
  • message::eye::DataPoint if log_level >= DEBUG, indicating if feet are down.

Dependencies

NUbots acknowledges the traditional custodians of the lands within our footprint areas: Awabakal, Darkinjung, Biripai, Worimi, Wonnarua, and Eora Nations. We acknowledge that our laboratory is situated on unceded Pambalong land. We pay respect to the wisdom of our Elders past and present.
Copyright © 2024 NUbots - CC-BY-4.0
Deploys by Netlify