amiro-os / devices / DiWheelDrive / DiWheelDrive.h @ 552936c8
History | View | Annotate | Download (1.63 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 | |||
30 | protected:
|
||
31 | virtual msg_t receiveMessage(CANRxFrame *frame); |
||
32 | virtual msg_t updateSensorVal(); |
||
33 | virtual void periodicBroadcast();
|
||
34 | |||
35 | void calibrateProximityFloorValues();
|
||
36 | |||
37 | private:
|
||
38 | uint32_t bcCounter; |
||
39 | // MotorControl *motorcontrol;
|
||
40 | // Odometry *odometry;
|
||
41 | // VCNL4020 (*vcnl4020)[4];
|
||
42 | // fileSystemIo::FSIODiWheelDrive *memory;
|
||
43 | // BaseLTC4412wEN *ltc4412;
|
||
44 | int actualSpeed[2]; |
||
45 | types::position robotPosition; |
||
46 | |||
47 | }; |
||
48 | |||
49 | } |
||
50 | |||
51 | #endif /* AMIRO_DI_WHEEL_DRIVE_H_ */ |