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);
Class for loading configuration file information.
Definition: configfile.h:196
virtual int MainSetup()
Sets up the resources needed by the driver thread.
Definition: segwayrmp.cc:293
Generic message header.
Definition: player.h:157
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
Definition: segwayrmp.cc:578
Definition: segwayrmp.h:37
A device address.
Definition: player.h:141
Definition: rmp_frame.h:70
Base class for drivers which oeprate with a thread.
Definition: driver.h:544
Data: state (PLAYER_POSITION3D_DATA_STATE)
Definition: player_interfaces.h:2470
Data: voltage (PLAYER_POWER_DATA_STATE)
Definition: player_interfaces.h:291
An autopointer for the message queue.
Definition: message.h:73
int USBSetup()
Sets up the USB bus for communication.
Definition: segwayrmp.cc:357
void UpdateData(rmp_frame_t *)
Definition: segwayrmp.cc:979
virtual void Main()
Main method for driver thread.
Definition: segwayrmp.cc:410
virtual void MainQuit()
Cleanup method for driver thread (called when main exits)
Definition: segwayrmp.cc:377
Definition: usb_packet.h:70
position2d data
Definition: player_interfaces.h:606
int CanBusSetup()
Sets up the CAN bus for communication.
Definition: segwayrmp.cc:336