Skip to content

Commit

Permalink
ros2: set bit mask in position setpoints
Browse files Browse the repository at this point in the history
Signed-off-by: Rhys Mainwaring <[email protected]>
  • Loading branch information
srmainwaring committed Mar 12, 2024
1 parent 380c29d commit eb2af50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 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,8 @@ 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 eb2af50

Please sign in to comment.