aboutsummaryrefslogtreecommitdiff
path: root/zumo/protocol.h
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-06-08 09:33:12 +0200
committerlonkaars <loek@pipeframe.xyz>2023-06-08 09:33:12 +0200
commitc81c6223b7d9e5973f5d2825c399d5777e093c58 (patch)
treea7eceaf2e0b6525f6aeacaedb1b33e42582529e8 /zumo/protocol.h
parent97939ee4eaad5937a0a2eee190b2b9028d009a97 (diff)
parent2903e61cbe2eeff3121f67da516ea195999f0bba (diff)
merge dev into master
Diffstat (limited to 'zumo/protocol.h')
-rw-r--r--zumo/protocol.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/zumo/protocol.h b/zumo/protocol.h
index a1f9951..ea3e27d 100644
--- a/zumo/protocol.h
+++ b/zumo/protocol.h
@@ -19,13 +19,24 @@ typedef enum {
DUI_SIGN_LIGHT_GO, /** @brief traffic light green (keep current speed) */
} dui_e_sign;
+const char* const DUI_SIGN_LOOKUP[16] = {
+ [DUI_SIGN_NONE] = "",
+ [DUI_SIGN_STOP] = "bord\nstop",
+ [DUI_SIGN_LEFT] = "bord\nlinks",
+ [DUI_SIGN_RIGHT] = "bord\nrechts",
+ [DUI_SIGN_SPEED_LIMIT_LOW] = "snelheid\nlaag",
+ [DUI_SIGN_SPEED_LIMIT_HIGH] = "snelheid\nhoog",
+ [DUI_SIGN_LIGHT_STOP] = "stop.l.\nrood",
+ [DUI_SIGN_LIGHT_FLOOR_IT] = "stop.l.\ngeel",
+ [DUI_SIGN_LIGHT_GO] = "stop.l.\ngroen",
+};
+
typedef struct {
float steer; /** @brief steer value (-1 is left, +1 is right) */
- float speed; /** @brief speed (0-15) */
+ float Speed; /** @brief speed (0-15) */
dui_e_sign current_sign; /** @brief last seen sign */
float speed_mod; /** @brief global speed multiplier */
} dui_state_t;
/** @brief read and apply cmd to state */
void handle_cmd(unsigned char cmd, dui_state_t *state);
-