amiro-os / devices / DiWheelDrive / DiWheelDrive.h @ a0033dcb
History | View | Annotate | Download (1.818 KB)
1 | 58fe0e0b | Thomas Schöpping | #ifndef AMIRO_DI_WHEEL_DRIVE_H_
|
---|---|---|---|
2 | #define AMIRO_DI_WHEEL_DRIVE_H_
|
||
3 | |||
4 | #include <amiro/ControllerAreaNetworkRx.h> |
||
5 | #include <amiro/ControllerAreaNetworkTx.h> |
||
6 | #include <amiro/MotorIncrements.h> |
||
7 | #include <amiro/MotorControl.h> |
||
8 | #include <amiro/Odometry.h> |
||
9 | #include <amiro/proximity/vcnl4020.hpp> |
||
10 | #include <Types.h> // kinematic |
||
11 | #include <amiro/FileSystemInputOutput/FSIODiWheelDrive.hpp> |
||
12 | #include <amiro/power/ltc4412.hpp> |
||
13 | #include <string.h> // memcpy |
||
14 | |||
15 | namespace amiro { |
||
16 | |||
17 | class DiWheelDrive : public ControllerAreaNetworkTx, public ControllerAreaNetworkRx { |
||
18 | public:
|
||
19 | DiWheelDrive(CANDriver *can);//, MotorControl *motorcontrol, Odometry *odometry, VCNL4020 (*vcnl4020)[4], fileSystemIo::FSIODiWheelDrive *memory, BaseLTC4412wEN *ltc4412);
|
||
20 | virtual void calibrate();
|
||
21 | |||
22 | /** \brief Handle the termination of ControllerAreaNetworkTx and ControllerAreaNetworkRx threads
|
||
23 | * This includes waiting until the threads have terminated, thus this function might block a relatively long time.
|
||
24 | */
|
||
25 | msg_t terminate(void);
|
||
26 | |||
27 | /** \brief Handle the start of ControllerAreaNetworkTx and ControllerAreaNetworkRx threads */
|
||
28 | ThreadReference start(tprio_t PRIO); |
||
29 | 8c99e03a | galberding | /**
|
30 | * Set Request to disable or enable the Charging.
|
||
31 | * @param power 0 to disable, 1 to enable
|
||
32 | */
|
||
33 | void requestCharging(uint8_t power);
|
||
34 | 3a4c95b0 | galberding | void transmitState(uint8_t 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_ */ |