Skip to main content

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​

ParameterDescription
vrefReference voltage in volts (typically 5.0)

Topics​

Published​

TopicTypeDescriptionRate
/<name>/ch_0std_msgs/Float32Channel 0 voltage20 Hz
/<name>/ch_1std_msgs/Float32Channel 1 voltage20 Hz
/<name>/ch_2std_msgs/Float32Channel 2 voltage20 Hz
/<name>/ch_3std_msgs/Float32Channel 3 voltage20 Hz

Service​

Service name: /<name>/cobra_cmd
Type: studica_control/SetData

Set request.initparams.n_encoder to the channel number (0 – 3).

CommandDescription
get_rawRaw ADC value for the requested channel
get_voltageVoltage reading for the requested channel