22 #include "canio_kvaser.h"
23 #include "usb_packet.h"
24 #include <libplayercore/playercore.h>
27 typedef enum { UNKNOWN, RS232, CANBUS, USB } BusType;
30 #define SPEEDTHRESH 0.01
79 const char* caniotype;
80 const char* usb_device;
84 float max_xspeed, max_yawspeed;
91 float curr_xspeed, curr_yawspeed;
92 float last_xspeed, last_yawspeed;
99 bool motor_allow_enable;
105 uint32_t last_raw_yaw, last_raw_left, last_raw_right, last_raw_foreaft;
108 double odom_x, odom_y, odom_yaw;
111 int HandlePositionConfig(
QueuePointer &resp_queue, uint32_t subtype,
void* data,
size_t len);
114 int HandlePosition3DConfig(
QueuePointer &resp_queue, uint32_t subtype,
void* data,
size_t len);
123 int Diff(uint32_t from, uint32_t to,
bool first);
132 void MakeStatusCommand(
CanPacket* pkt, uint16_t cmd, uint16_t val);
135 void MakeVelocityCommand(
CanPacket* pkt, int32_t xspeed, int32_t yawspeed);
137 void MakeShutdownCommand(
CanPacket* pkt);