a

Dependencies:   mbed mbed-rtos

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers safetystopfunction.hpp Source File

safetystopfunction.hpp

00001 /**
00002   ******************************************************************************
00003   * @file    SafetyStopFunction.hpp
00004   * @author  RBRO/PJ-IU
00005   * @version V1.0.0
00006   * @date    day-month-2017
00007   * @brief   This file contains the class declaration for the safety stop activation
00008   *          methods.
00009   ******************************************************************************
00010  */
00011 
00012 /* Include guard */
00013 #ifndef SAFETY_STOP_FUNCTION_HPP
00014 #define SAFETY_STOP_FUNCTION_HPP
00015 
00016 /* Required for the use of C_IR_DistanceSensorDriver */
00017 #include <SHARP_IR_distance\IR_DistanceSensorDriver\ir_distancesensordriver.hpp>
00018 
00019 
00020 /**
00021  * @brief It is used for deciding whether to activate safetyu stop depending on
00022  * distance sensors reading.
00023  * 
00024  */
00025 class CSafetyStopFunction{
00026 public:
00027     /* Construnctor */
00028     CSafetyStopFunction(C_IR_DistanceSensorDriver& f_senLeftFront
00029                         , C_IR_DistanceSensorDriver& f_senMidLeftFront
00030                         , C_IR_DistanceSensorDriver& f_senCenterFront
00031                         , C_IR_DistanceSensorDriver& f_senMidRightFront
00032                         , C_IR_DistanceSensorDriver& f_senRightFront
00033                         // , C_IR_DistanceSensorDriver& f_senLeftBach
00034                         // , C_IR_DistanceSensorDriver& f_senRightBach
00035                         );
00036 
00037     /* Destructor */
00038     ~CSafetyStopFunction();
00039 
00040     /* Function for activating safety stop */
00041     bool isSafetyStopActive(float f_speed, float f_angle);
00042     /* Serial callback method */
00043     static void staticSerialCallback(void* obj,char const * a, char * b);
00044 private:
00045     /* Serial callback actions */
00046     void serialCallback(char const * a, char * b);
00047     /* The functionality active state*/
00048     bool  m_active;
00049     /* Current car speed */
00050     float m_speed;
00051     /* Current steering angle */
00052     float m_angle;
00053     /* Front sensors */
00054     C_IR_DistanceSensorDriver& m_senLeftFront;
00055     C_IR_DistanceSensorDriver& m_senMidLeftFront;
00056     C_IR_DistanceSensorDriver& m_senCenterFront;
00057     C_IR_DistanceSensorDriver& m_senMidRightFront;
00058     C_IR_DistanceSensorDriver& m_senRightFront;
00059     /* Back sensors */
00060     // C_IR_DistanceSensorDriver& m_senLeftBach;
00061     // C_IR_DistanceSensorDriver& m_senRightBach;
00062     /* Serial communication member */
00063     /* USED FOR DEBUG */
00064 };
00065 
00066 /* Include guard */
00067 #endif
00068 
00069 
00070 
00071 
00072 
00073 
00074 
00075