Skip to content

Low level attitude control - topic cmd_attitude_setpoint #490

Answered by whoenig
GusBon asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think cmd_attitude_setpoints exists. There is cmd_vel_legacy that can take desired attitudes as input (

void cmd_vel_legacy_changed(const geometry_msgs::msg::Twist::SharedPtr msg)
{
float roll = msg->linear.y;
float pitch = - (msg->linear.x);
float yawrate = msg->angular.z;
uint16_t thrust = std::min<uint16_t>(std::max<float>(msg->linear.z, 0.0), 60000);
// RCLCPP_INFO(logger_, "roll: %f, pitch: %f, yaw: %f, thrust: %u", roll, pitch, yawrate, (unsigned int)thrust);
cf_.sendSetpoint(roll, pitch, yawrate, thrust);
}
in the cpp backend).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GusBon
Comment options

Answer selected by GusBon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants