Merge superviseur/robot depuis la branche dev
This commit is contained in:
parent
34be2bb151
commit
491fae55d5
9 changed files with 19 additions and 37 deletions
1
software/raspberry/superviseur-robot/README.md
Normal file
1
software/raspberry/superviseur-robot/README.md
Normal file
|
@ -0,0 +1 @@
|
|||
# TP-RT_C
|
6
software/raspberry/superviseur-robot/lib/.gitignore
vendored
Normal file
6
software/raspberry/superviseur-robot/lib/.gitignore
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
CMakeFiles/
|
||||
|
||||
libdestjil.a
|
||||
Makefile
|
||||
*.cmake
|
||||
|
|
@ -21,13 +21,6 @@
|
|||
|
||||
using namespace cv;
|
||||
|
||||
/**
|
||||
* Create an object for accessing camera with default values (size = sm and
|
||||
* fps = 10)
|
||||
*/
|
||||
Camera::Camera():Camera(sm, 10){
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an object for accessing camera
|
||||
* @param size Size of picture to grab (@see captureSize)
|
||||
|
|
|
@ -35,16 +35,9 @@ enum captureSize {xs, sm, md, lg};
|
|||
* Class for camera (image grab)
|
||||
*
|
||||
* @brief Class for camera (image grab)
|
||||
* How to grab an image and send it to the monitor:
|
||||
* 1. Grab an image, for example:
|
||||
* Img * img = new Img(cam->Grab());
|
||||
* 2. Instanciate the message to send the image:
|
||||
* MessageImg *msgImg = new MessageImg(MESSAGE_CAM_IMAGE, img);
|
||||
*/
|
||||
class Camera {
|
||||
public:
|
||||
Camera();
|
||||
|
||||
/**
|
||||
* Create an object for accessing camera
|
||||
* @param size Size of picture to grab (@see captureSize)
|
||||
|
|
|
@ -131,7 +131,7 @@ Message* Message::Copy() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Check message ID
|
||||
* Get message ID
|
||||
* @return Current message ID
|
||||
*/
|
||||
bool Message::CheckID(MessageID id) {
|
||||
|
@ -162,6 +162,7 @@ MessageInt::MessageInt() {
|
|||
*/
|
||||
MessageInt::MessageInt(MessageID id, int val) {
|
||||
MessageInt::SetID(id);
|
||||
|
||||
value = val;
|
||||
}
|
||||
|
||||
|
@ -281,7 +282,6 @@ bool MessageString::CheckID(MessageID id) {
|
|||
* Create a new, empty image message
|
||||
*/
|
||||
MessageImg::MessageImg() {
|
||||
this->messageID = MESSAGE_CAM_IMAGE;
|
||||
image = NULL;
|
||||
}
|
||||
|
||||
|
@ -362,7 +362,6 @@ bool MessageImg::CheckID(MessageID id) {
|
|||
* Create a new, empty battery message
|
||||
*/
|
||||
MessageBattery::MessageBattery() {
|
||||
this->messageID = MESSAGE_ROBOT_BATTERY_LEVEL;
|
||||
this->level = BATTERY_UNKNOWN;
|
||||
}
|
||||
|
||||
|
@ -456,10 +455,9 @@ bool MessageBattery::CheckID(MessageID id) {
|
|||
/* class MessagePosition */
|
||||
|
||||
/**
|
||||
* Create a new, empty position message
|
||||
* Create a new, empty string message
|
||||
*/
|
||||
MessagePosition::MessagePosition() {
|
||||
this->messageID = MESSAGE_CAM_POSITION;
|
||||
this->pos.angle = 0.0;
|
||||
this->pos.robotId = 0;
|
||||
this->pos.center.x=0.0;
|
||||
|
@ -469,9 +467,9 @@ MessagePosition::MessagePosition() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a new position message, with given ID and position
|
||||
* Create a new string message, with given ID and string
|
||||
* @param id Message ID
|
||||
* @param pos Message position
|
||||
* @param s Message string
|
||||
* @throw std::runtime_error if message ID is incompatible with string data
|
||||
*/
|
||||
MessagePosition::MessagePosition(MessageID id, Position& pos) {
|
||||
|
|
|
@ -47,7 +47,7 @@ typedef enum {
|
|||
MESSAGE_ROBOT_COM_OPEN,
|
||||
MESSAGE_ROBOT_COM_CLOSE,
|
||||
|
||||
// Messages for camera from Monitor to Supervisor
|
||||
// Messages for camera
|
||||
MESSAGE_CAM_OPEN,
|
||||
MESSAGE_CAM_CLOSE,
|
||||
MESSAGE_CAM_ASK_ARENA,
|
||||
|
@ -55,8 +55,6 @@ typedef enum {
|
|||
MESSAGE_CAM_ARENA_INFIRM,
|
||||
MESSAGE_CAM_POSITION_COMPUTE_START,
|
||||
MESSAGE_CAM_POSITION_COMPUTE_STOP,
|
||||
|
||||
// Messages for camera from Supervisor to Monitor
|
||||
MESSAGE_CAM_POSITION,
|
||||
MESSAGE_CAM_IMAGE,
|
||||
|
||||
|
@ -501,14 +499,7 @@ protected:
|
|||
* Message class for holding battery level, based on Message class
|
||||
*
|
||||
* @brief Battery message class
|
||||
* How to use:
|
||||
* 1. Ask the battery level to the robot:
|
||||
* MessageBattery * msg;
|
||||
* msg = (MessageBattery*)robot.Write(new Message(MESSAGE_ROBOT_BATTERY_GET));
|
||||
* 2. Send the message, for example:
|
||||
* monitor.send(msg);
|
||||
* or
|
||||
* WriteInQueue(&q_messageToMon, msg);
|
||||
*
|
||||
*/
|
||||
class MessageBattery : public Message {
|
||||
public:
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</conf>
|
||||
<conf name="Debug__RPI_" type="1">
|
||||
<toolsSet>
|
||||
<developmentServer>pi@10.105.1.08:22</developmentServer>
|
||||
<developmentServer>pi@10.105.1.13:22</developmentServer>
|
||||
<platform>2</platform>
|
||||
</toolsSet>
|
||||
<dbx_gdbdebugger version="1">
|
||||
|
|
|
@ -7,12 +7,12 @@
|
|||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||
<group>
|
||||
<file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/lib/camera.h</file>
|
||||
<file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/lib/messages.cpp</file>
|
||||
<file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/main.cpp</file>
|
||||
<file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/tasks.h</file>
|
||||
<file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/lib/camera.cpp</file>
|
||||
<file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/tasks.cpp</file>
|
||||
<file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/lib/comrobot.h</file>
|
||||
<file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/lib/messages.h</file>
|
||||
<file>file:/home_pers/pehladik/dumber/software/raspberry/superviseur-robot/lib/commonitor.h</file>
|
||||
</group>
|
||||
</open-files>
|
||||
</project-private>
|
||||
|
|
|
@ -64,7 +64,7 @@ private:
|
|||
/**********************************************************************/
|
||||
ComMonitor monitor;
|
||||
ComRobot robot;
|
||||
int robotStarted = 0;
|
||||
int robotStarted;
|
||||
int move = MESSAGE_ROBOT_STOP;
|
||||
|
||||
/**********************************************************************/
|
||||
|
|
Loading…
Reference in a new issue