Merge pull request #8 from SemvdH/main

fix some errors
This commit is contained in:
SemvdH
2023-05-22 11:37:39 +02:00
committed by GitHub
4 changed files with 4 additions and 10 deletions

1
call_attitude.sh Executable file
View File

@@ -0,0 +1 @@
ros2 service call /drone/set_attitude drone_services/srv/SetAttitude "{pitch: $1, yaw: $2, roll: $3, thrust: $4}"

View File

@@ -28,6 +28,7 @@ add_executable(heartbeat src/heartbeat.cpp)
ament_target_dependencies(
heartbeat
rclcpp
drone_services
px4_ros_com
px4_msgs
drone_services

View File

@@ -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);