Can we inject actuator command via MAVSDK for offboard control?
I cannot find an example of injecting actuator commands for offboard control.
For example, thrust command or rotor angular rate.
What about these?
Actuator control: http://mavsdk-python-docs.s3-website.eu-central-1.amazonaws.com/plugins/offboard.html#mavsdk.offboard.Offboard.set_actuator_control
Attitude rate control: http://mavsdk-python-docs.s3-website.eu-central-1.amazonaws.com/plugins/offboard.html#mavsdk.offboard.Offboard.set_attitude_rate
Ok, there are appropriate functions :)
But there is no example with direct actuator control, right?
There is not but it would be great if you contribute one. :smile:
As I'm still not familiar with details of offboard control, I would appreciate if MAVSDK-Python provides an example of direct actuator control :)
There is not but it would be great if you contribute one. 😄
Of course I will if I find an appropriate working example!
I think you can try it in simulation.
So do you actually need attitude rate control, or actuator control? Because that's not the same thing.
I think you can try it in simulation.
So do you actually need attitude rate control, or actuator control? Because that's not the same thing.
Sorry for the confusion.
What I'm trying to do is actuator control.
Ok, and that's with PX4? And what is the use case? If I understand more context, I might be able to help with your actual problem.
Ok, and that's with PX4? And what is the use case? If I understand more context, I might be able to help with your actual problem.
Yup, with PX4.
I'm trying to inject actuator control input from an external device (e.g., RPi or GCS) to Pixhawk (equipped with PX4) via MAVSDK. This is for testing a custom controller and ease of usage.
~~BTW, what does "actuator control" stand for, exactly? (rotor thrust?)~~ According to offboard.py, it seems to be a throttle scaled from -1 to 1. What does "throttle" mean exactly? For example, if I wanna inject a signal as "the first rotor's thrust should be 1N", what should I do?
Throttle in this case just means that the motor spins from low to max, 0..1, from what I can read.
Throttle in this case just means that the motor spins from low to max, 0..1, from what I can read.
Thanks as always :) So it's literally "throttle" like the throttle in RC controller. Is there any systematic or heuristic way to send a thrust command like "the first rotor's thrust should be 1N"?
No, it's throttle as in PWM to a motor, I believe.
Just try it out in SITL (with lockstep disabled).
Thank you a lot!
@JinraeKim did it worked? can you send direct pwm cmds to motors from offboard by mavsdk?
@JinraeKim did it worked? can you send direct pwm cmds to motors from offboard by mavsdk?
TBH, I don't remember clearly cuz our team is decided not to use MAVSDK for offboard control... I'm sorry. I guess it didn't work well (or was hard to figure out what each variable means).
@hnlee77 Do you remember any things about this?
TBH, I don't remember clearly cuz our team is decided not to use MAVSDK for offboard control... I'm sorry. I guess it didn't work well (or was hard to figure out what each variable means).
@hnlee77 Do you remember any things about this?
@Traveller30 Yeah, it didn't work well. we couldn't send direct pwm cmds to motors. so now, we decided send only attitude cmds for offboard by mavsdk.
ok , thank you
Kind reminder: contributions are always welcome if a MAVSDK feature doesn't work well :+1:.
Hello, @JinraeKim , just checking to see if there are any updates on this? I'm trying to send a command directly to each quadcopter motor rather than use higher level functions like "takeoff" or "land", and an example would be very helpful. Have you figured it out?
Hello, @JinraeKim , just checking to see if there are any updates on this? I'm trying to send a command directly to each quadcopter motor rather than use higher level functions like "takeoff" or "land", and an example would be very helpful. Have you figured it out?
We are no longer working on this topic so there is no update so far :<
Offboard control using actuator controls has actually been removed in more recent versions of PX4.
Thanks! Does that mean the offboard.set_actuator_control function wouldn't work?
I know this might not be the place for this question, but how are people sending actuator commands from a host computer to their quadcopter? I've been trying to figure that out using mavsdk-python.
It should still work for v1.13: https://github.com/PX4/PX4-Autopilot/blob/release/1.13/src/modules/mavlink/mavlink_receiver.cpp#LL160C3-L160C45