amiro-os / devices / DiWheelDrive / DiWheelDrive.h @ 309980f0
History | View | Annotate | Download (1.859 KB)
1 | 58fe0e0b | Thomas Schöpping | #ifndef AMIRO_DI_WHEEL_DRIVE_H_
|
---|---|---|---|
2 | #define AMIRO_DI_WHEEL_DRIVE_H_
|
||
3 | #include <amiro/ControllerAreaNetworkRx.h> |
||
4 | #include <amiro/ControllerAreaNetworkTx.h> |
||
5 | #include <amiro/MotorIncrements.h> |
||
6 | #include <amiro/MotorControl.h> |
||
7 | #include <amiro/Odometry.h> |
||
8 | #include <amiro/proximity/vcnl4020.hpp> |
||
9 | #include <Types.h> // kinematic |
||
10 | #include <amiro/FileSystemInputOutput/FSIODiWheelDrive.hpp> |
||
11 | #include <amiro/power/ltc4412.hpp> |
||
12 | #include <string.h> // memcpy |
||
13 | |||
14 | namespace amiro { |
||
15 | |||
16 | class DiWheelDrive : public ControllerAreaNetworkTx, public ControllerAreaNetworkRx { |
||
17 | public:
|
||
18 | DiWheelDrive(CANDriver *can);//, MotorControl *motorcontrol, Odometry *odometry, VCNL4020 (*vcnl4020)[4], fileSystemIo::FSIODiWheelDrive *memory, BaseLTC4412wEN *ltc4412);
|
||
19 | virtual void calibrate();
|
||
20 | |||
21 | /** \brief Handle the termination of ControllerAreaNetworkTx and ControllerAreaNetworkRx threads
|
||
22 | * This includes waiting until the threads have terminated, thus this function might block a relatively long time.
|
||
23 | */
|
||
24 | msg_t terminate(void);
|
||
25 | |||
26 | /** \brief Handle the start of ControllerAreaNetworkTx and ControllerAreaNetworkRx threads */
|
||
27 | ThreadReference start(tprio_t PRIO); |
||
28 | 8c99e03a | galberding | /**
|
29 | * Set Request to disable or enable the Charging.
|
||
30 | * @param power 0 to disable, 1 to enable
|
||
31 | */
|
||
32 | void requestCharging(uint8_t power);
|
||
33 | 84b4c632 | galberding | void transmitState(int8_t state);
|
34 | 309980f0 | galberding | void transmitMapState(map_state state);
|
35 | 58fe0e0b | Thomas Schöpping | |
36 | protected:
|
||
37 | virtual msg_t receiveMessage(CANRxFrame *frame); |
||
38 | virtual msg_t updateSensorVal(); |
||
39 | virtual void periodicBroadcast();
|
||
40 | |||
41 | void calibrateProximityFloorValues();
|
||
42 | |||
43 | private:
|
||
44 | uint32_t bcCounter; |
||
45 | // MotorControl *motorcontrol;
|
||
46 | // Odometry *odometry;
|
||
47 | // VCNL4020 (*vcnl4020)[4];
|
||
48 | // fileSystemIo::FSIODiWheelDrive *memory;
|
||
49 | // BaseLTC4412wEN *ltc4412;
|
||
50 | int actualSpeed[2]; |
||
51 | types::position robotPosition; |
||
52 | |||
53 | }; |
||
54 | |||
55 | } |
||
56 | |||
57 | #endif /* AMIRO_DI_WHEEL_DRIVE_H_ */ |