Commit ac713d82 authored by Amine AIT-GANI's avatar Amine AIT-GANI
Browse files

Mise a jour des fonctions de test

parent e096f527
Pipeline #1534 failed with stage
in 1 minute and 16 seconds
......@@ -16,6 +16,7 @@
#include <thread>
#include <mutex>
#include <sys/time.h>
//#include <mavlink_msg_compassmot_status>
......@@ -53,7 +54,7 @@ public:
Serial_Port_ReadingThread(int task_period, int task_deadline);
~Serial_Port_ReadingThread();
int task_period = 1000;
int task_period = 500;
void run();
......
......@@ -35,7 +35,7 @@ protected:
public:
int task_period = 100000;
int task_period = 250;
/**
* Default constructor of the class. Need to have the
......
......@@ -24,6 +24,7 @@
#include "Com_Serial.h"
#include "Com_Wifi.h"
//#include "common/mavlink_msg_compassmot_status.h"
/**
* Define about drone communication protocol. it's use to automatic open specific communication
......@@ -47,9 +48,68 @@ enum Drone_Motors{
*/
enum Drone_mode{
DRONE_OFF,
DRONE_MANUAL_DIRECT // Mode manual with direct control of the motors
DRONE_MANUAL_DIRECT
// Mode manual with direct control of the motors
};
enum class FlightMode {
Unknown,
Ready,
Takeoff,
Hold,
Mission,
ReturnToLaunch,
Land,
Offboard,
FollowMe,
Manual,
Altctl,
Posctl,
Acro,
Rattitude,
Stabilized,
};
namespace px4 {
enum PX4_CUSTOM_MAIN_MODE {
PX4_CUSTOM_MAIN_MODE_MANUAL = 1,
PX4_CUSTOM_MAIN_MODE_ALTCTL,
PX4_CUSTOM_MAIN_MODE_POSCTL,
PX4_CUSTOM_MAIN_MODE_AUTO,
PX4_CUSTOM_MAIN_MODE_ACRO,
PX4_CUSTOM_MAIN_MODE_OFFBOARD,
PX4_CUSTOM_MAIN_MODE_STABILIZED,
PX4_CUSTOM_MAIN_MODE_RATTITUDE
};
enum PX4_CUSTOM_SUB_MODE_AUTO {
PX4_CUSTOM_SUB_MODE_AUTO_READY = 1,
PX4_CUSTOM_SUB_MODE_AUTO_TAKEOFF,
PX4_CUSTOM_SUB_MODE_AUTO_LOITER,
PX4_CUSTOM_SUB_MODE_AUTO_MISSION,
PX4_CUSTOM_SUB_MODE_AUTO_RTL,
PX4_CUSTOM_SUB_MODE_AUTO_LAND,
PX4_CUSTOM_SUB_MODE_AUTO_RTGS,
PX4_CUSTOM_SUB_MODE_AUTO_FOLLOW_TARGET
};
union px4_custom_mode {
struct {
uint16_t reserved;
uint8_t main_mode;
uint8_t sub_mode;
};
uint32_t data;
float data_float;
};
} // namespace px4
/**
* Drone classes
*/
......@@ -61,7 +121,7 @@ public:
Drone_Communication drone_communication;
Drone_Motors motors=UNARM;
Drone_mode mode=DRONE_OFF;
// Drone_mode mode=DRONE_OFF;
//Communication part
......@@ -165,7 +225,8 @@ public:
/**
* Convey to change the mode of the drone
*/
int command_setMode(Drone_mode mode);
int command_setMode(Drone_mode my_mode);
int command_arm(int param1);
......@@ -174,8 +235,8 @@ public:
int command_kill(int param1);
int command_setModeGuided(float param1);
// int command_setModeGuided(float param1);
int make_command_msg_rate(int param1);
int command_directControl(float x, float y, float z, float r);
int return_to_launch(int param1);
int take(int param1) ;
......@@ -183,6 +244,14 @@ public:
int landing();
int command_right(float param1) ;
int command_left(float param1) ;
int go_to();
int waypointrl(float param5);
int waypointforback(float param6);
int waypointupdown(float param7);
int take_off_vtol();
int followhold();
int make_mode(int param1);
int move_to(float param1, float param2, float param3);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment