[89] | 1 | /// Description of the CAN structures for Robotex car (Renault Fluence ZE)
|
---|
| 2 | ///
|
---|
| 3 | /// @date created 2012/06/21
|
---|
| 4 | /// @author Gerald Dherbomez
|
---|
| 5 | /// @copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 6 | /// @version $Id: $
|
---|
| 7 |
|
---|
| 8 | #ifndef __STRUCTURECANFLUENCEZE_H__
|
---|
| 9 | #define __STRUCTURECANFLUENCEZE_H__
|
---|
| 10 |
|
---|
| 11 | #include <cstddef>
|
---|
| 12 |
|
---|
| 13 | #include "kernel/cstdint.h"
|
---|
| 14 | #include "kernel/road_time.h"
|
---|
| 15 |
|
---|
| 16 | /// Vehicle speed CAN frame
|
---|
| 17 | /// corresponding CAN frame = 0x5D7 - frequency 10 Hz
|
---|
| 18 | /// 0.6 km/h minimum threshold
|
---|
| 19 | typedef struct
|
---|
| 20 | {
|
---|
| 21 | float vehicleSpeed; ///< low frequency vehicle speed (in km/h)
|
---|
| 22 | int32_t accurateOdometer; ///< accurate odometer for car equiped with electrical brake (in cm)
|
---|
| 23 | } StructFluenceZeLowSpeed;
|
---|
| 24 |
|
---|
| 25 | typedef struct
|
---|
| 26 | {
|
---|
| 27 | road_time_t time;
|
---|
| 28 | road_timerange_t timerange;
|
---|
| 29 | StructFluenceZeLowSpeed d;
|
---|
| 30 | } TimestampedStructFluenceZeLowSpeed;
|
---|
| 31 |
|
---|
| 32 | /// Front Wheel speed CAN frame
|
---|
| 33 | /// corresponding CAN frame = 0x29A - frequency 50 Hz
|
---|
| 34 | typedef struct
|
---|
| 35 | {
|
---|
| 36 | float frontLeftWheelSpeed; ///< speed of the front left wheel (in rpm) - min threshold 5 rpm
|
---|
| 37 | float frontRightWheelSpeed; ///< speed of the front right wheel (in rpm) - idem
|
---|
| 38 | float averageFrontWheelSpeed; ///< average front wheels speed (in km/h)
|
---|
| 39 | } StructFluenceZeFrontWheelSpeed;
|
---|
| 40 |
|
---|
| 41 | typedef struct
|
---|
| 42 | {
|
---|
| 43 | road_time_t time;
|
---|
| 44 | road_timerange_t timerange;
|
---|
| 45 | StructFluenceZeFrontWheelSpeed d;
|
---|
| 46 | } TimestampedStructFluenceZeFrontWheelSpeed;
|
---|
| 47 |
|
---|
| 48 | /// Rear Wheel speed CAN frame
|
---|
| 49 | /// corresponding CAN frame = 0x29C - frequency 50 Hz
|
---|
| 50 | typedef struct
|
---|
| 51 | {
|
---|
| 52 | float rearLeftWheelSpeed; ///< speed of the front left wheel (in rpm)
|
---|
| 53 | float rearRightWheelSpeed; ///< speed of the front right wheel (in rpm)
|
---|
| 54 | float fourWheelReferenceSpeed; ///< four wheels reference speed (in km/h) available for 4x4 only
|
---|
| 55 | } StructFluenceZeRearWheelSpeed;
|
---|
| 56 |
|
---|
| 57 | typedef struct
|
---|
| 58 | {
|
---|
| 59 | road_time_t time;
|
---|
| 60 | road_timerange_t timerange;
|
---|
| 61 | StructFluenceZeRearWheelSpeed d;
|
---|
| 62 | } TimestampedStructFluenceZeRearWheelSpeed;
|
---|
| 63 |
|
---|
| 64 | /// Steering wheel CAN frame
|
---|
| 65 | /// corresponding CAN frame = 0x0C6 - 100 Hz
|
---|
| 66 | /// min -3276.7 / max 3276.7 for all values
|
---|
| 67 | typedef struct
|
---|
| 68 | {
|
---|
| 69 | float angle; ///< in deg >0 in trigonometric direction (to the left)
|
---|
| 70 | float rotationSpeed; ///< in deg/s
|
---|
| 71 | float angleOffset; ///< in deg
|
---|
| 72 | } StructFluenceZeSteeringWheel;
|
---|
| 73 |
|
---|
| 74 | typedef struct
|
---|
| 75 | {
|
---|
| 76 | road_time_t time;
|
---|
| 77 | road_timerange_t timerange;
|
---|
| 78 | StructFluenceZeSteeringWheel d;
|
---|
| 79 | } TimestampedStructFluenceZeSteeringWheel;
|
---|
| 80 |
|
---|
| 81 | /// Vehicle Kinematics CAN frame
|
---|
| 82 | /// corresponding CAN frame = 0x12E - frequency 100 Hz
|
---|
| 83 | typedef struct
|
---|
| 84 | {
|
---|
| 85 | float yawRate; ///< >0 in trigonometric direction in deg/s (min -204.7deg/s, max 204.7deg/s)
|
---|
| 86 | float transversalAcc; ///< >0 (??) to the right in g (min -1.8g, max 1.8g)
|
---|
| 87 | float longitudinalAccProc; ///< >0 (??) to the right in m/s2 (min -10m/s2, max 2.7m/s2)
|
---|
| 88 | } StructFluenceZeKinematics;
|
---|
| 89 |
|
---|
| 90 | typedef struct
|
---|
| 91 | {
|
---|
| 92 | road_time_t time;
|
---|
| 93 | road_timerange_t timerange;
|
---|
| 94 | StructFluenceZeKinematics d;
|
---|
| 95 | } TimestampedStructFluenceZeKinematics;
|
---|
| 96 |
|
---|
| 97 | /// Gears lever position
|
---|
| 98 | /// corresponding CAN frame = 0x17E - frequency 100 Hz
|
---|
| 99 | typedef struct
|
---|
| 100 | {
|
---|
| 101 | enum GearLeverPosition
|
---|
| 102 | {
|
---|
| 103 | Parking = 0
|
---|
| 104 | , Reverse = 1
|
---|
| 105 | , Neutral = 2
|
---|
| 106 | , Drive = 3
|
---|
| 107 | };
|
---|
| 108 |
|
---|
| 109 | uint8_t position; ///< 0x00 parking ; 0x01 reverse ; 0x02 neutral ; 0x03 drive (in the order of the lever)
|
---|
| 110 | } StructFluenceZeGears;
|
---|
| 111 |
|
---|
| 112 | typedef struct
|
---|
| 113 | {
|
---|
| 114 | road_time_t time;
|
---|
| 115 | road_timerange_t timerange;
|
---|
| 116 | StructFluenceZeGears d;
|
---|
| 117 | } TimestampedStructFluenceZeGears;
|
---|
| 118 |
|
---|
| 119 | #endif
|
---|