Ricbot sensorbox: Difference between revisions
(Created page with "Back to Ricbot == Sensorbox == The sensorbox is a relatively self-contained box with camera sensors and electronics to support and record data from these sensors. External requirements are power (14-29V) and about 20W. Connection to odometry and GNSS are through cabled Ethernet and MQTT. == Configuration == The sensorbox contains * 4 Basler cameras * A Raspberry Pi version 5 with SSD hard disk. * A trigger management microprocessor (Teensy 4.0) * A power distri...") |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 57: | Line 57: | ||
** 'cam' is the trigger command. | ** 'cam' is the trigger command. | ||
** 'A' is the delay from camera 1 trigger to camera 2 trigger in us. If zero, then there is no camera 2 trigger. | ** 'A' is the delay from camera 1 trigger to camera 2 trigger in us. If zero, then there is no camera 2 trigger. | ||
** 'B' is the delay to start of flash in us. | ** 'B' is the delay to the start of the flash in us. | ||
** 'F' is the duration of the flash in us. If zero, then there is no flash signal. | ** 'F' is the duration of the flash in us. If zero, then there is no flash signal. | ||
** 'R' is repeat timing in ms. | ** 'R' is the repeat timing in ms. | ||
* Camera 1 is always triggered when the message is received. | * Camera 1 is always triggered when the message is received. | ||
Example: | Example: | ||
* 'cam 0 0 0 1000': No camera 2 trigger, no flash, camera 1 trigger every 1000ms (1 sec). | * 'cam 0 0 0 1000': No camera 2 trigger, no flash, camera 1 trigger every 1000ms (1 sec). | ||
* 'cam 100 200 50 1000': Camera 2 trigger 100us after camera 1, flash starts 200us after camera 1 and illuminates for 50us. All are retriggered every 1000ms (1 sec). | |||
The trigger command is initiated by the ''cam_mqtt'' app in the ''svn/ricbot/cam_mqtt'' directory. | |||
The trigger command is specified in the ''svn/ricbot/cam_mqtt/build'' directory, in the ''robot.ini'' file. The ''trigger'' group configures the trigger. | |||
The robot.ini file, trigger part: | |||
[trigger] | |||
log = true | |||
use = true | |||
trigger_interval_ms = 1000 | |||
trigger_cam2_us = 0 | |||
trigger_flash_delay_us = 0 | |||
trigger_flash_duration_us = 0 | |||
== Recording control == | |||
The red button on the side of the box controls the recording. | |||
* Pressed once starts recording. | |||
* Pressing again will pause the recording. | |||
When recording, there is an LED in the LED-band that will illuminate (orange) for every camera that is recording. If the camera is not found or has failed, the corresponding LED will not illuminate. | |||
The red recording button is connected directly to the Raspberry Pi and monitored by the ''cam_mqtt'' app. | |||
The recording is saved in the ''build'' directory for the ''cam_mqtt'' app. A new recording directory is generated with every reboot of the Raspberry Pi. | |||
Images are saved at full camera resolution in .jpg format. | |||
Latest revision as of 15:43, 29 July 2026
Back to Ricbot
Sensorbox
The sensorbox is a relatively self-contained box with camera sensors and electronics to support and record data from these sensors.
External requirements are power (14-29V) and about 20W.
Connection to odometry and GNSS are through cabled Ethernet and MQTT.
Configuration
The sensorbox contains
- 4 Basler cameras
- A Raspberry Pi version 5 with SSD hard disk.
- A trigger management microprocessor (Teensy 4.0)
- A power distribution board with the ability for sequenced turn-on and turn-off.
- 12 V supply for cameras and common trigger junction board.
- A forward-looking Raspberry Pi camera (12 Mpixel)
- Possibly 2 multispectral cameras.
Function
Startup
When power is connected (XT60 plug), nothing happens. The power board requires a start signal.
The power switch has 3 positions:
- the down position gives an on signal to the power distribution board.
- Centre position is neutral (on or off)
- Up is delayed off; leave in this position when off (forced off).
Start-up issue
When everything is powered on at the same time, it happens that the cameras do not (all) get an IP in the right way, and thus are unavailable.
The reason is that the Raspberry Pi is running the DNS server providing the camera IP, but takes time to start, as does the network switch. This could be handled by using a static camera IP, but at times it is appropriate to connect the camera switch to an established cabled network, where the cameras should follow that network. This is needed to fully utilise the Basler Pylon software.
To solve this, the cameras will be supplied with a delayed turn-on. The delayed turn-on utilises one of the two power plugs on the power distribution intended for motor power. This allows the Raspberry Pi and the network switch to be ready before the cameras are turned on. The turn-on delay is controlled by the microprocessor.
Delayed turn-on is not implemented yet.
Trigger control
The microprocessor controls the triggers. It can issue 2 camera triggers and control an LED-based flash.
- Camera trigger 1 is intended for the Baslar cameras. It is a 3.3V signal, where the leading edge (low to high) is the trigger signal. The trailing edge should not be used. The pulse is at least 3ms.
- Camera trigger 2 is intended for the multi-spectral cameras and is also a 3.3V leading-edge signal. This signal can be delayed relative to the camera 1 signal.
- The flash signal is a positive pulse, where the delay and length are controllable.
Triggering is activated by a command from the Raspberry Pi by an MQTT message
- topic: 'dtubot/cmd/T0' message 'cam A B F R', where:
- 'cam' is the trigger command.
- 'A' is the delay from camera 1 trigger to camera 2 trigger in us. If zero, then there is no camera 2 trigger.
- 'B' is the delay to the start of the flash in us.
- 'F' is the duration of the flash in us. If zero, then there is no flash signal.
- 'R' is the repeat timing in ms.
- Camera 1 is always triggered when the message is received.
Example:
- 'cam 0 0 0 1000': No camera 2 trigger, no flash, camera 1 trigger every 1000ms (1 sec).
- 'cam 100 200 50 1000': Camera 2 trigger 100us after camera 1, flash starts 200us after camera 1 and illuminates for 50us. All are retriggered every 1000ms (1 sec).
The trigger command is initiated by the cam_mqtt app in the svn/ricbot/cam_mqtt directory. The trigger command is specified in the svn/ricbot/cam_mqtt/build directory, in the robot.ini file. The trigger group configures the trigger.
The robot.ini file, trigger part:
[trigger] log = true use = true trigger_interval_ms = 1000 trigger_cam2_us = 0 trigger_flash_delay_us = 0 trigger_flash_duration_us = 0
Recording control
The red button on the side of the box controls the recording.
- Pressed once starts recording.
- Pressing again will pause the recording.
When recording, there is an LED in the LED-band that will illuminate (orange) for every camera that is recording. If the camera is not found or has failed, the corresponding LED will not illuminate.
The red recording button is connected directly to the Raspberry Pi and monitored by the cam_mqtt app.
The recording is saved in the build directory for the cam_mqtt app. A new recording directory is generated with every reboot of the Raspberry Pi.
Images are saved at full camera resolution in .jpg format.