From c9f546cb0ca5f025c22285bdbbd66561d45c657e Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Fri, 28 Apr 2023 17:53:46 +0200 Subject: [PATCH] try different values --- src/px4_connection/src/heartbeat.cpp | 2 +- src/px4_connection/src/px4_controller.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/px4_connection/src/heartbeat.cpp b/src/px4_connection/src/heartbeat.cpp index e662fbdf..52f6f87d 100644 --- a/src/px4_connection/src/heartbeat.cpp +++ b/src/px4_connection/src/heartbeat.cpp @@ -26,7 +26,7 @@ public: // create timer to send heartbeat messages (offboard control) every 100ms timer_ = this->create_wall_timer(100ms, std::bind(&HeartBeat::send_heartbeat, this)); start_time = this->get_clock()->now().seconds(); - RCLCPP_INFO(this->get_logger(), "done initializing after %d seconds. Sending heartbeat...", start_time); + RCLCPP_INFO(this->get_logger(), "done initializing at %d seconds. Sending heartbeat...", start_time); } private: diff --git a/src/px4_connection/src/px4_controller.cpp b/src/px4_connection/src/px4_controller.cpp index ee243962..fd34008c 100644 --- a/src/px4_connection/src/px4_controller.cpp +++ b/src/px4_connection/src/px4_controller.cpp @@ -42,7 +42,7 @@ public: timer_ = this->create_wall_timer(1000ms, std::bind(&PX4Controller::send_setpoint, this)); start_time_ = this->get_clock()->now().seconds(); - RCLCPP_INFO(this->get_logger(), "finished initializing after %d seconds.", start_time_); + RCLCPP_INFO(this->get_logger(), "finished initializing at %d seconds.", start_time_); } private: @@ -64,14 +64,14 @@ private: // result quaternion std::array q = {0, 0, 0, 0}; - if (this->get_clock()->now().seconds() - start_time_ < 5) + if (this->get_clock()->now().seconds() - start_time_ < 10) { // move up? msg.thrust_body[0] = 0; // north - msg.thrust_body[1] = 0; // east + msg.thrust_body[1] = 0.1; // east msg.thrust_body[2] = 1; // down, 100% thrust up - calculate_quaternion(q, degrees_to_radians(40), 0, 0); + calculate_quaternion(q, degrees_to_radians(10), 0, 0); } else { @@ -85,7 +85,7 @@ private: msg.thrust_body[1] = 0; // east msg.thrust_body[2] = 0; // down - calculate_quaternion(q, degrees_to_radians(270), 0, 0); + calculate_quaternion(q, degrees_to_radians(10), 0, 0); } msg.q_d[0] = q.at(0);