Skip to content
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

Closed
TSC21 opened this issue Aug 13, 2014 · 7 comments
Closed

Update setpoint_attitude plugin #106

TSC21 opened this issue Aug 13, 2014 · 7 comments

Comments

@TSC21
Copy link
Member

TSC21 commented Aug 13, 2014

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.

@vooon
Copy link
Member

vooon commented Aug 13, 2014

Thrust ignore bit already set (it's a bit confusing that bit enumeration starts from 1).

@vooon vooon closed this as completed in 28b072a Aug 14, 2014
@ziyangli
Copy link

I am very confused! Shouldn't we give desired roll, pitch, yaw angle and throttle at the same time? In twist_cb throttle is set to be 0, it sounds to me that the UAV will just drop down.

@vooon
Copy link
Member

vooon commented Dec 18, 2014

In twist_cb all fields except RPY ignored, so it doesn't change throttle.

@ziyangli
Copy link

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?

@mhkabir
Copy link
Member

mhkabir commented Dec 20, 2014

@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.

@ziyangli
Copy link

@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!

@mhkabir
Copy link
Member

mhkabir commented Dec 20, 2014

@ziyangli Introducing a new message wouldn't be bad as-such. You can implement a new message with all the fields.
Remember to encode the proper bit such that the autopilot uses all the RPYT value. ( I'm not sure if PX4 actually checks it though )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants