HiveMind
BSP.h
Go to the documentation of this file.
1 #ifndef __BSP_H_
2 #define __BSP_H_
3 
4 #include "bsp/IBSP.h"
5 #include <BaseTask.h>
6 #include <random>
7 #include <ros/ros.h>
8 
9 class BSP : public IBSP {
10  public:
11  BSP();
12  ~BSP() override;
13 
14  void initChip(void* args) override;
15 
16  uint16_t getUUId() const override;
17 
18  uint32_t generateRandomNumber() override;
19 
20  std::shared_ptr<ros::NodeHandle> getRosNodeHandle();
21 
22  private:
23  std::shared_ptr<ros::NodeHandle> m_rosNodeHandle;
24  BaseTask<2 * configMINIMAL_STACK_SIZE> m_rosWatchTask;
25 
26  std::mt19937 m_rng;
27  std::uniform_int_distribution<uint32_t> m_distribution;
28 };
29 
30 #endif // __BSP_H_
BSP::m_rosWatchTask
BaseTask< 2 *configMINIMAL_STACK_SIZE > m_rosWatchTask
Definition: BSP.h:24
IBSP.h
BSP::m_rng
std::mt19937 m_rng
Definition: BSP.h:26
BSP::getUUId
uint16_t getUUId() const override
Returns the unique id associated with the board.
Definition: BSP.cpp:40
BSP::BSP
BSP()
Definition: BSP.cpp:23
BSP::~BSP
~BSP() override
BSP::m_rosNodeHandle
std::shared_ptr< ros::NodeHandle > m_rosNodeHandle
Definition: BSP.h:23
IBSP
Definition: IBSP.h:6
BSP::getRosNodeHandle
std::shared_ptr< ros::NodeHandle > getRosNodeHandle()
Definition: BSP.cpp:38
BSP::m_distribution
std::uniform_int_distribution< uint32_t > m_distribution
Definition: BSP.h:27
BSP
Definition: BSP.h:9
BSP::generateRandomNumber
uint32_t generateRandomNumber() override
Returns a positive random number, uses an hardware RNG if available.
Definition: BSP.cpp:42
BSP::initChip
void initChip(void *args) override
Initialise the chip for usage. Needs to be called early in the program.
Definition: BSP.cpp:30