-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dba09a6
commit 4ba20a6
Showing
2 changed files
with
41 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
/** | ||
* @brief ConvoyLeader application | ||
* @author Andreas Merkle <[email protected]> | ||
* | ||
* | ||
* @addtogroup Application | ||
* | ||
* @{ | ||
|
@@ -60,13 +60,14 @@ | |
class App | ||
{ | ||
public: | ||
|
||
/** | ||
* Construct the convoy leader application. | ||
*/ | ||
App() : | ||
m_serialMuxProtChannelIdOdometry(0U), | ||
m_systemStateMachine(), | ||
m_controlInterval(), | ||
m_reportOdometryTimer(), | ||
m_smpServer(Serial) | ||
{ | ||
} | ||
|
@@ -89,25 +90,27 @@ class App | |
void loop(); | ||
|
||
private: | ||
|
||
/** Differential drive control period in ms. */ | ||
static const uint32_t DIFFERENTIAL_DRIVE_CONTROL_PERIOD = 5U; | ||
|
||
/** Name of Channel to send Position Data to. */ | ||
static const char* POSITION_CHANNEL; | ||
|
||
/** DLC of Position Channel */ | ||
static const uint8_t POSITION_CHANNEL_DLC = 8U; | ||
/** Odometry reporting period in ms. */ | ||
static const uint32_t REPORT_ODOMETRY_PERIOD = 100U; | ||
|
||
/** Baudrate for Serial Communication */ | ||
static const uint32_t SERIAL_BAUDRATE = 115200U; | ||
|
||
/** SerialMuxProt Channel id for sending the current odometry. */ | ||
uint8_t m_serialMuxProtChannelIdOdometry; | ||
|
||
/** The system state machine. */ | ||
StateMachine m_systemStateMachine; | ||
|
||
/** Timer used for differential drive control processing. */ | ||
SimpleTimer m_controlInterval; | ||
|
||
/** Timer for reporting odometry through SerialMuxProt. */ | ||
SimpleTimer m_reportOdometryTimer; | ||
|
||
/** | ||
* SerialMuxProt Server Instance | ||
* | ||
|
@@ -117,18 +120,13 @@ class App | |
SerialMuxProtServer<10U> m_smpServer; | ||
|
||
/** | ||
* Report the current position of the robot using the Odometry data. | ||
* Report the current position and heading of the robot using the Odometry data. | ||
* Sends data through the SerialMuxProtServer. | ||
*/ | ||
void reportPosition(); | ||
|
||
/** | ||
* Callback for incoming data from the Position Channel. | ||
* @param[in] payload Byte buffer containing incomming data. | ||
* @param[in] payloadSize Number of bytes received. | ||
*/ | ||
static void positionCallback(const uint8_t* payload, const uint8_t payloadSize); | ||
void reportOdometry(); | ||
|
||
private: | ||
/* An instance shall not be copied or assigned. */ | ||
App(const App& app); | ||
App& operator=(const App& app); | ||
}; | ||
|