1
call_attitude.sh
Executable file
1
call_attitude.sh
Executable file
@@ -0,0 +1 @@
|
||||
ros2 service call /drone/set_attitude drone_services/srv/SetAttitude "{pitch: $1, yaw: $2, roll: $3, thrust: $4}"
|
||||
@@ -28,6 +28,7 @@ add_executable(heartbeat src/heartbeat.cpp)
|
||||
ament_target_dependencies(
|
||||
heartbeat
|
||||
rclcpp
|
||||
drone_services
|
||||
px4_ros_com
|
||||
px4_msgs
|
||||
drone_services
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/**
|
||||
* @file heartbeat.cpp
|
||||
* @author Sem van der Hoeven (sem.hoeven@gmail.com)
|
||||
@@ -62,15 +63,6 @@ private:
|
||||
msg.attitude = (this->control_mode >> CONTROL_ATTITUDE_POS) & 1 ? true : false;
|
||||
msg.body_rate = (this->control_mode >> CONTROL_BODY_RATE_POS) & 1 ? true : false;
|
||||
msg.actuator = (this->control_mode >> CONTROL_ACTUATOR_POS) & 1 ? true : false;
|
||||
|
||||
/*
|
||||
msg.position = false;
|
||||
msg.velocity = false;
|
||||
msg.acceleration = false;
|
||||
msg.attitude = true;
|
||||
msg.body_rate = false;
|
||||
msg.actuator = false;
|
||||
*/
|
||||
// get timestamp and publish message
|
||||
msg.timestamp = this->get_clock()->now().nanoseconds() / 1000;
|
||||
offboard_control_mode_publisher_->publish(msg);
|
||||
|
||||
Submodule src/px4_msgs updated: b64ef0475c...ffc3a4cd57
Reference in New Issue
Block a user