mavlink / MAVSDK-Java

MAVSDK client for Java.
71 stars 41 forks source link

newbie question : controlling aux (pwm 6-16) #55

Closed zeevmindali closed 2 years ago

zeevmindali commented 3 years ago

Dear all,

I started to learn on this sdk, mange to figure out most of question. how can I control with Java, the pwm6-16, I mean, I want to send a signal to servo, for open/close the hook.

tried to look for it, didn't found it :(

zeev

JonasVautherin commented 3 years ago

Does that exist in MAVSDK already? What MAVLink messages would you expect to use?

zeev-mindali commented 2 years ago

RC9_FUNCTION And wryie values 1100-1900

julianoes commented 2 years ago

PX4 or ArduPilot is the first thing that I need to know.

zeev-mindali commented 2 years ago

ArduPilot , using mission planner

JonasVautherin commented 2 years ago

So MAVSDK implements the set_actuator function.

It is using the MAVLink MAV_CMD_DO_SET_ACTUATOR command here: https://github.com/mavlink/MAVSDK/blob/main/src/mavsdk/plugins/action/action_impl.cpp#L462-L492

My feeling is that if you set the index to 9 and the value to whatever you need, it should be sent correctly, as implemented here.

zeev-mindali commented 2 years ago

didn't find this option in java

zeev-mindali commented 2 years ago

It adopted only in px4 not on ardu

JonasVautherin commented 2 years ago

You don't have setActuator in the action plugin in Java?

Or are you saying that MAV_CMD_DO_SET_ACTUATOR is not supported by Ardupilot?

zeev-mindali commented 2 years ago

Dear friend, i found out that i can use command 183 (DO_SET_SERVO) to control, tried via mavproxy all is working. now i trying to connect via java (both java and android) and getting connection refused. i using herelink remote device and set the ip and port that it's using.

what am i missing?

zeev-mindali commented 2 years ago

i see that mavsdk is not for ardupilot :( , will seek for alternative option

julianoes commented 2 years ago

Yes, ArduPilot support is limited and not so easy to achieve due to the differences in how the MAVLink spec is implemented by the two flight stacks. We are trying to get more aligned in the future but it's small steps.

JonasVautherin commented 2 years ago

Is DO_SET_SERVO the Ardupilot equivalent to MAV_CMD_DO_SET_ACTUATOR then?

zeev-mindali commented 2 years ago

when i run with mavproxy, i controlled the aux1-8 with desired pwm value

julianoes commented 2 years ago

Is DO_SET_SERVO the Ardupilot equivalent to MAV_CMD_DO_SET_ACTUATOR then?

That would be good to know.