-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update setpoint_attitude plugin #106
Comments
Thrust ignore bit already set (it's a bit confusing that bit enumeration starts from 1). |
I am very confused! Shouldn't we give desired roll, pitch, yaw angle and throttle at the same time? In |
In |
I see. Then why don't you add another cb that handels both RPY and throttle at the same time? Now you have to send RPY and throttle one after the other. If they both change frequently, wouldn't it be a burden for the serial port? |
@ziyangli Hi, ROS doesn't allow overloading callbacks. The only other way here would be to implement a new message type, which we would rather prefer not to. |
@mhkabir , thank you for your promt response! I understand that geometry/Twist is not able to contain the throttle field, but I also think it is normal to implement a new message type in this case, because this is MAVROS, a ros package designed for UAV. Anyway, if you seperate RPY and throttle into two callbacks only due to the reason you have mentioned, then I can add another callback in my fork, without worrying about making something wrong. Thank you for your answer! |
@ziyangli Introducing a new message wouldn't be bad as-such. You can implement a new message with all the fields. |
Now the bit 7 allows to ignore the input thrust value. (https://pixhawk.ethz.ch/mavlink/#SET_ATTITUDE_TARGET), which is needed in case of attitude only control.
Bit mapping should be changed in https://github.com/vooon/mavros/blob/master/mavros/src/plugins/setpoint_attitude.cpp#L140 and https://github.com/vooon/mavros/blob/master/mavros/src/plugins/setpoint_attitude.cpp#L164.
A thrust callback can now be added in: https://github.com/vooon/mavros/blob/master/mavros/src/plugins/setpoint_attitude.cpp#L175. The read values can be normalized between 0 and 1 (with the possibility of adding a parameter which sets normalization from -1 to 1 to vehicles capable of reverse thrust). Possible subscription to a std_msgs/Float64 type of msg.
The text was updated successfully, but these errors were encountered: