Vehicle Control Unit
0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Core
Inc
Sensors
DigitalSensors
WheelSpeed.h
Go to the documentation of this file.
1
#ifndef RENSSELAERMOTORSPORT_WHEELSPEED_H
2
#define RENSSELAERMOTORSPORT_WHEELSPEED_H
3
4
#include "../DigitalSensor.h"
5
#include "../../Utils/WheelLocation.h"
6
7
typedef
struct
{
8
DigitalSensor
base
;
9
WHEEL_LOCATION
wheel_location
;
10
float
speed
;
11
float
radius
;
12
float
interval
;
13
int
numTeeth
;
14
int
pulses
;
15
}
WheelSpeed
;
16
27
void
initWheelSpeed
(
WheelSpeed
* ws,
int
hz,
int
port,
float
radius,
int
numTeeth,
28
WHEEL_LOCATION
location);
35
float
calculateSpeed
(
WheelSpeed
* ws);
36
42
void
updateWheelSpeed
(
void
* ws);
43
51
void
setTimeInterval
(
WheelSpeed
* ws,
float
interval);
52
60
void
addPulse
(
WheelSpeed
* wf,
int
num);
61
62
#endif
// RENSSELAERMOTORSPORT_WHEELSPEED_H
WHEEL_LOCATION
WHEEL_LOCATION
Definition:
WheelLocation.h:4
addPulse
void addPulse(WheelSpeed *wf, int num)
Add pulses to sensor;.
Definition:
WheelSpeed.c:66
setTimeInterval
void setTimeInterval(WheelSpeed *ws, float interval)
Set time interval.
Definition:
WheelSpeed.c:62
updateWheelSpeed
void updateWheelSpeed(void *ws)
Updated the speed var in this sensor.
Definition:
WheelSpeed.c:57
calculateSpeed
float calculateSpeed(WheelSpeed *ws)
Translates data to speed in mph.
Definition:
WheelSpeed.c:24
initWheelSpeed
void initWheelSpeed(WheelSpeed *ws, int hz, int port, float radius, int numTeeth, WHEEL_LOCATION location)
Initialization function for a wheel speed sensor.
Definition:
WheelSpeed.c:12
DigitalSensor
Definition:
DigitalSensor.h:6
WheelSpeed
Definition:
WheelSpeed.h:7
WheelSpeed::wheel_location
WHEEL_LOCATION wheel_location
Definition:
WheelSpeed.h:9
WheelSpeed::interval
float interval
Definition:
WheelSpeed.h:12
WheelSpeed::speed
float speed
Definition:
WheelSpeed.h:10
WheelSpeed::pulses
int pulses
Definition:
WheelSpeed.h:14
WheelSpeed::radius
float radius
Definition:
WheelSpeed.h:11
WheelSpeed::base
DigitalSensor base
Definition:
WheelSpeed.h:8
WheelSpeed::numTeeth
int numTeeth
Definition:
WheelSpeed.h:13
Generated by
1.9.5