Skip to content

Commit

Permalink
ros2: set bit mask in position setpoints (#54)
Browse files Browse the repository at this point in the history
Signed-off-by: Rhys Mainwaring <[email protected]>
  • Loading branch information
srmainwaring authored Mar 13, 2024
1 parent 380c29d commit 0c6d734
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions terrain_navigation_ros/src/terrain_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,8 @@ void TerrainPlanner::publishGlobalPositionSetpoints(
mavros_msgs::msg::GlobalPositionTarget msg;
msg.header.stamp = this->get_clock()->now();
msg.coordinate_frame = mavros_msgs::msg::GlobalPositionTarget::FRAME_GLOBAL_REL_ALT;
msg.type_mask = 0.0;
msg.type_mask =
mavros_msgs::msg::GlobalPositionTarget::IGNORE_YAW | mavros_msgs::msg::GlobalPositionTarget::IGNORE_YAW_RATE;
msg.latitude = latitude;
msg.longitude = longitude;
msg.altitude = altitude - local_origin_altitude_;
Expand All @@ -790,7 +791,7 @@ void TerrainPlanner::publishPositionSetpoints(rclcpp::Publisher<mavros_msgs::msg
mavros_msgs::msg::PositionTarget msg;
msg.header.stamp = this->get_clock()->now();
msg.coordinate_frame = mavros_msgs::msg::PositionTarget::FRAME_LOCAL_NED;
msg.type_mask = 0.0;
msg.type_mask = mavros_msgs::msg::PositionTarget::IGNORE_YAW | mavros_msgs::msg::PositionTarget::IGNORE_YAW_RATE;
msg.position.x = position(0);
msg.position.y = position(1);
msg.position.z = position(2);
Expand Down

0 comments on commit 0c6d734

Please sign in to comment.