Cobra
The Cobra node reads a 4-channel analog reflectance sensor array over I2C and publishes a voltage topic per channel. Primarily used for line following.
Configuration​
cobra:
enabled: true
sensors: ["line_sensor"]
line_sensor:
vref: 5.0
Parameters​
| Parameter | Description |
|---|---|
vref | Reference voltage in volts (typically 5.0) |
Topics​
Published​
| Topic | Type | Description | Rate |
|---|---|---|---|
/<name>/ch_0 | std_msgs/Float32 | Channel 0 voltage | 20 Hz |
/<name>/ch_1 | std_msgs/Float32 | Channel 1 voltage | 20 Hz |
/<name>/ch_2 | std_msgs/Float32 | Channel 2 voltage | 20 Hz |
/<name>/ch_3 | std_msgs/Float32 | Channel 3 voltage | 20 Hz |
Service​
Service name: /<name>/cobra_cmd
Type: studica_control/SetData
Set request.initparams.n_encoder to the channel number (0 – 3).
| Command | Description |
|---|---|
get_raw | Raw ADC value for the requested channel |
get_voltage | Voltage reading for the requested channel |