Statistics
| Branch: | Tag: | Revision:

amiro-os / devices / DiWheelDrive / DiWheelDrive.h @ 8c99e03a

History | View | Annotate | Download (1.786 KB)

1
#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
    * 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

    
35
  protected:
36
    virtual msg_t receiveMessage(CANRxFrame *frame);
37
    virtual msg_t updateSensorVal();
38
    virtual void periodicBroadcast();
39

    
40
    
41

    
42
    void  calibrateProximityFloorValues();
43

    
44
  private:
45
    uint32_t bcCounter;
46
//    MotorControl *motorcontrol;
47
//    Odometry *odometry;
48
//    VCNL4020 (*vcnl4020)[4];
49
//    fileSystemIo::FSIODiWheelDrive *memory;
50
//    BaseLTC4412wEN *ltc4412;
51
    int actualSpeed[2];
52
    types::position robotPosition;
53

    
54
  };
55

    
56
}
57

    
58
#endif /* AMIRO_DI_WHEEL_DRIVE_H_ */