add control modes h file
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
# bit 4: velocity
|
||||
# bit 5: position
|
||||
|
||||
# used control modes:
|
||||
# 4: attitude and thrust
|
||||
# 16: velocity
|
||||
# 32: position
|
||||
int32 control # control bitmask
|
||||
---
|
||||
int8 status # status of operation
|
||||
15
src/px4_connection/include/drone_control_modes.h
Normal file
15
src/px4_connection/include/drone_control_modes.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef DRONE_CONTROL_MODES_H
|
||||
#define DRONE_CONTROL_MODES_H
|
||||
|
||||
#define CONTROL_MODE_ATTITUDE 1
|
||||
#define CONTROL_MODE_VELOCITY 2
|
||||
#define CONTROL_MODE_POSITION 3
|
||||
|
||||
#define CONTROL_ACTUATOR_POS 0
|
||||
#define CONTROL_BODY_RATE_POS 1
|
||||
#define CONTROL_ATTITUDE_POS 2
|
||||
#define CONTROL_ACCELERATION_POS 3
|
||||
#define CONTROL_VELOCITY_POS 4
|
||||
#define CONTROL_POSITION_POS 5
|
||||
|
||||
#endif
|
||||
@@ -10,16 +10,9 @@
|
||||
#include <drone_services/srv/set_vehicle_control.hpp>
|
||||
#include <drone_services/msg/drone_control_mode.hpp>
|
||||
|
||||
#define CONTROL_MODE_ATTITUDE 1
|
||||
#define CONTROL_MODE_VELOCITY 2
|
||||
#define CONTROL_MODE_POSITION 3
|
||||
#include "drone_control_modes.h"
|
||||
|
||||
|
||||
#define CONTROL_ACTUATOR_POS 0
|
||||
#define CONTROL_BODY_RATE_POS 1
|
||||
#define CONTROL_ATTITUDE_POS 2
|
||||
#define CONTROL_ACCELERATION_POS 3
|
||||
#define CONTROL_VELOCITY_POS 4
|
||||
#define CONTROL_POSITION_POS 5
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include <std_srvs/srv/empty.hpp>
|
||||
|
||||
#include "drone_control_modes.h"
|
||||
|
||||
#define D_SPEED(x) -x - 9.81
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
Reference in New Issue
Block a user