Rover API Documentation
rover_grooveultrasonic.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 FH Dortmund and others
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Description:
9  * RoverGrooveUltrasonic API - Interfaces for Rover Groove ultrasonic sensor application development
10  * Header file
11  *
12  * Contributors:
13  * M.Ozcelikors <mozcelikors@gmail.com>, created RoverGrooveUltrasonic class 04.12.2017
14  *
15  */
16 
17 #ifndef ROVERAPI_ROVER_GROOVEULTRASONIC_HPP_
18 #define ROVERAPI_ROVER_GROOVEULTRASONIC_HPP_
19 
21 
25 static const int SIG0 = 0; //BCM-17 -> WiringPi 0 //Same as ECHO0 pin, if some one wants to replace front sr04 with groove sensor
26 
30 static const int SIG1 = 2; //BCM-27 -> WiringPi 2 //Same as ECHO1 pin, if some one wants to replace back sr04 with groove sensor
31 
32 namespace rover
33 {
38  {
39  private:
44 
48  int sigPin;
49 
50  public:
55  explicit RoverGrooveUltrasonic (const RoverSensorID_t sensor_id);
56 
61 
66  void initialize (void);
67 
72  float read (void);
73 
79  void setSigPin (const int sig_pin);
80 
85  int getSigPin (void);
86  };
87 }
88 
89 
90 
91 #endif /* ROVERAPI_ROVER_GROOVEULTRASONIC_HPP_ */
~RoverGrooveUltrasonic()
Destructor for the RoverGrooveUltrasonic class.
Definition: rover_grooveultrasonic.cpp:41
RoverSensor class is an abstract class to define interface between common sensors used in the rover...
Definition: rover_sensor.hpp:48
void setSigPin(const int sig_pin)
Sets the private attribute sigPin for Groove Ultrasonic Sensor.
Definition: rover_grooveultrasonic.cpp:82
RoverGrooveUltrasonic is a class that is inherited from RoverSensor abstract class. RoverGrooveUltrasonic class contains member functions and variables to set up and read from Groove ultrasonic sensors that are embedded on the rover.
Definition: rover_grooveultrasonic.hpp:37
RoverSensorID_t sensorID
Sensor Identification.
Definition: rover_grooveultrasonic.hpp:43
RoverSensorID_t
RoverSensorID_t defines the sensor location ID of the proximity sensors on the rover.
Definition: rover_sensor.hpp:38
void initialize(void)
Function to setup Groove Ultrasonic sensor.
Definition: rover_grooveultrasonic.cpp:43
static const int SIG1
Groove Sensor Pin for Rear Sensor Socket (in wiringPi format)
Definition: rover_grooveultrasonic.hpp:30
int sigPin
Signal pin.
Definition: rover_grooveultrasonic.hpp:48
static const int SIG0
Groove Sensor Pin for Front Sensor Socket (in wiringPi format)
Definition: rover_grooveultrasonic.hpp:25
float read(void)
Member function to read from Groove ultrasonic sensor given its sensor id.
Definition: rover_grooveultrasonic.cpp:48
rover Namespace contains classes to manage Rover sensors, gpio, buzzer, buttons, driving, utilities, and cloud.
Definition: rover_api.hpp:293
RoverGrooveUltrasonic(const RoverSensorID_t sensor_id)
Constructor for the RoverGrooveUltrasonic class.
Definition: rover_grooveultrasonic.cpp:22
int getSigPin(void)
Returns the private attribute sigPin for Groove Ultrasonic Sensor.
Definition: rover_grooveultrasonic.cpp:87