Im working on a couple of uavcan nodes for my bike, mainly
- a handlebar node
- a headlight node
- a taillight node
The handlebar is connected to a couple of switches
- front and read break lever sensors
- throttle 0-100%
- ignition button
- turn signal sw
- headlight lo/hi beam sw
- horn button
How should I implement the uavcan protocol for the handlebar node?
Should send a heartbeat and a status message with something like
{
int throttle, // 0-100 %
bit breakSensor // 1 on 0 off
bit signalLeft, // 1 on 0 off
bit signalRight, // 1 on 0 off
bit loBeam, // 1 on 0 off
bit hiBeam, // 1 on 0 off
bit loBeamAlt, // 1 on 0 off
bit hiBeamAlt, // 1 on 0 off
bit horn, // 1 on 0 off
}
and subscribe from the headlight and taillight node to handlebars status messages. Or should a send one message for each value? Is there standard message for esc’s to subscribe to for reading throttle value and break sensors.for example?
If standard datatypes is available, which of them should I use?