Rover API Documentation
rover_driving.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  * Rover Driving API - Interfaces for Rover driving application development - Header file
10  *
11  * Contributors:
12  * M.Ozcelikors <mozcelikors@gmail.com>, created API 17.11.2017
13  *
14  */
15 
16 #ifndef API_ROVER_DRIVING_HPP_
17 #define API_ROVER_DRIVING_HPP_
18 
19 namespace rover
20 {
21  /* Rover driving speeds */
25  static const int LOWEST_SPEED = 360;
26 
30  static const int HIGHEST_SPEED = 480;
31 
35  static const int STOPPING_SPEED = 0;
36 
41  {
42  private:
46  int SPEED;
47 
52 
53  public:
54 
58  explicit RoverDriving();
59 
63  ~RoverDriving();
64 
68  void initialize();
69 
73  void stopRover();
74 
78  void setSpeed (const int speed_setpoint);
79 
83  int getSpeed (void);
84 
88  void differentialDrive(const float angular_speed, const float linear_speed );
89 
93  void goForward ();
94 
98  void goBackward ();
99 
103  void turnRight ();
104 
108  void turnLeft ();
109 
113  void turnForwardLeft ();
114 
118  void turnForwardRight ();
119 
123  void turnBackwardLeft ();
124 
128  void turnBackwardRight ();
129 
130  };
131 }
132 
133 
134 #endif /* API_ROVER_DRIVING_HPP_ */
void goBackward()
Commands the rover to go backward.
Definition: rover_driving.cpp:176
void setSpeed(const int speed_setpoint)
Sets the speed. 360 -> Lowest speed (RoverDriving::LOWEST_SPEED), 480 -> Highest speed (RoverDriving:...
Definition: rover_driving.cpp:44
int SPEED
Speed for the rover movement. 360 -> Lowest speed (RoverDriving::LOWEST_SPEED), 480 -> Highest speed ...
Definition: rover_driving.hpp:46
void differentialDrive(const float angular_speed, const float linear_speed)
Set the speed of the right and left wheels.
Definition: rover_driving.cpp:78
void turnLeft()
Commands the rover to turn left on its spot.
Definition: rover_driving.cpp:140
Contains the member functions to drive the rover using its motors.
Definition: rover_driving.hpp:40
RoverDriving()
Constructor for RoverDriving class.
Definition: rover_driving.cpp:27
static const int STOPPING_SPEED
Static definition to hold stopping speed for rover.
Definition: rover_driving.hpp:35
static const int HIGHEST_SPEED
Static definition to hold highest driving speed for rover.
Definition: rover_driving.hpp:30
rover Namespace contains classes to manage Rover sensors, gpio, buzzer, buttons, driving, utilities, and cloud.
Definition: rover_api.hpp:293
int ROVERDRIVING_INIT_
Flag to hold if RoverDriving is initialized.
Definition: rover_driving.hpp:51
void goForward()
Commands the rover to go forward.
Definition: rover_driving.cpp:164
void turnForwardLeft()
Commands the rover to turn forward-left using only one motor.
Definition: rover_driving.cpp:104
void turnBackwardRight()
Commands the rover to turn backward-right using only one motor.
Definition: rover_driving.cpp:116
~RoverDriving()
Destructor for RoverDriving class.
Definition: rover_driving.cpp:34
void turnForwardRight()
Commands the rover to turn forward-right using only one motor.
Definition: rover_driving.cpp:92
void initialize()
Initializes RoverDriving features.
Definition: rover_driving.cpp:54
int getSpeed(void)
Retrieves the current speed setpoint.
Definition: rover_driving.cpp:49
void stopRover()
Commands the rover to stop.
Definition: rover_driving.cpp:188
void turnRight()
Commands the rover to turn right on its spot.
Definition: rover_driving.cpp:152
static const int LOWEST_SPEED
Static definition to hold lowest driving speed for rover.
Definition: rover_driving.hpp:25
void turnBackwardLeft()
Commands the rover to turn backward-left using only one motor.
Definition: rover_driving.cpp:128