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

connected with a real drone problem #174

Open
wangpuxia opened this issue Aug 6, 2024 · 14 comments
Open

connected with a real drone problem #174

wangpuxia opened this issue Aug 6, 2024 · 14 comments

Comments

@wangpuxia
Copy link

hi

I set up a mavsdk environment on the server and tested it using jmavsim. Everything work fine
But when I connected the real drone to Mavsdk, Some functions can be used normally, such as

System drone = new System ( "123.201.28.156" , 50041 ) ;
drone.getTelemetry().getFlightMode().subscribe(flightMode -> logger.info("Flight mode: " + flightMode));

It can return the flightmode data correctly, but most functions such as

drone.getAction ( ).arm ( ) or
drone.getTelemetry ( ).getBattery ( )

do not provide any feedback. The server will output content similar to the following:

[09:49:05|Info ] MAVSDK version: v2.11.0 (mavsdk_impl.cpp:26)
[09:49:05|Info ] Waiting to discover system on udp://:14552... (connection_initiator.h:20)
[09:50:20|Info ] New system on: 39.144.112.2:48334 (with system ID: 1) (udp_connection.cpp:199)
[09:50:20|Debug] New system ID: 1 Comp ID: 1 (mavsdk_impl.cpp:720)
[09:50:20|Debug] Component Autopilot (1) added. (system_impl.cpp:366)
[09:50:20|Warn ] Vehicle type changed (new type: 2, old type: 0) (system_impl.cpp:217)
[09:50:20|Debug] Discovered 1 component(s) (system_impl.cpp:509)
[09:50:20|Info ] System discovered (connection_initiator.h:62)
[09:50:20|Info ] Server started (grpc_server.cpp:169)
[09:50:20|Info ] Server set to listen on 0.0.0.0:50042 (grpc_server.cpp:170)
[09:50:21|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[09:50:21|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)
[09:50:22|Debug] MAVLink: info: u-blox 1 HW: 00080000 SW: EXT CORE 3.01 (107900) (system_impl.cpp:243)
[09:50:51|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[09:50:51|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)
[09:51:17|Warn ] sending again after 0.502024 s, retries to do: 3 (512). (mavlink_command_sender.cpp:320)
[09:51:17|Warn ] Request was for msg ID: 242 (mavlink_command_sender.cpp:326)
[09:51:18|Warn ] sending again, retries to do: 5 (mavlink_parameter_client.cpp:1057)
[09:51:21|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[09:51:21|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)
[09:51:51|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[09:51:51|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)
[09:52:13|Warn ] sending again after 0.501734 s, retries to do: 3 (512). (mavlink_command_sender.cpp:320)
[09:52:13|Warn ] Request was for msg ID: 242 (mavlink_command_sender.cpp:326)
[09:52:21|Warn ] sending again after 0.51101 s, retries to do: 3 (512). (mavlink_command_sender.cpp:320)
[09:52:21|Warn ] Request was for msg ID: 242 (mavlink_command_sender.cpp:326)
[09:52:21|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[09:52:21|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)
[09:52:50|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[09:52:50|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)
[09:53:20|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[09:53:20|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)
[09:53:50|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[09:53:50|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)
[09:54:20|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[09:54:20|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)

May I ask where the problem occurred? and how to fix it.

@JonasVautherin
Copy link
Collaborator

It seems like the autopilot is refusing to arm:

 [09:50:21|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[09:50:21|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)

@wangpuxia
Copy link
Author

It seems like the autopilot is refusing to arm:

 [09:50:21|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[09:50:21|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)

yes, thank you ,what should i do next?

1 similar comment
@wangpuxia
Copy link
Author

It seems like the autopilot is refusing to arm:

 [09:50:21|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[09:50:21|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)

yes, thank you ,what should i do next?

@wangpuxia
Copy link
Author

MAVSDK

the code is simple like this:

System drone = new System ( "101.201.28.156" , 50042 ) ;
drone.getAction ( ).arm ( )
.doOnComplete ( ( ) -> logger.debug ( "Arming..." ) )
.doOnError ( throwable -> {
logger.error ( "Failed to arm: " + ( ( Action.ActionException ) throwable ).getCode ( ) );
} ).subscribe ( latch::countDown , throwable -> latch.countDown ( ) ) ;

log message is : Failed to arm: UNKNOWN

MAVSDK console is:
[02:41:10|Warn ] sending again after 0.506188 s, retries to do: 3 (511). (mavlink_command_sender.cpp:320)
[02:41:23|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[02:41:23|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)
[02:41:40|Warn ] sending again after 0.505487 s, retries to do: 3 (400). (mavlink_command_sender.cpp:320)
[02:41:41|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[02:41:41|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:243)
[02:41:53|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)

@JonasVautherin
Copy link
Collaborator

Are you running PX4 or Ardupilot?

@julianoes
Copy link
Contributor

[02:41:23|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[02:41:23|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:24

That's why it doesn't arm.

@wangpuxia
Copy link
Author

Ardupilot

pixhawk 2.4.8

@wangpuxia
Copy link
Author

[02:41:23|Debug] MAVLink: critical: PreArm: Throttle below Failsafe (system_impl.cpp:243)
[02:41:23|Debug] MAVLink: critical: PreArm: Hardware safety switch (system_impl.cpp:24

That's why it doesn't arm.

thanks, but what i do with the drone to fix " Throttle below Failsafe " problem ?

@JonasVautherin
Copy link
Collaborator

Ardupilot

Maybe that's why it doesn't send battery updates? @julianoes Doesn't Ardupilot require to set the message rate?

@julianoes
Copy link
Contributor

Doesn't Ardupilot require to set the message rate?

I think ArduPilot requires it, yes.

@wangpuxia
Copy link
Author

Ardupilot

Maybe that's why it doesn't send battery updates? @julianoes Doesn't Ardupilot require to set the message rate?

i try to find out how to set message rate

@wangpuxia
Copy link
Author

wangpuxia commented Aug 11, 2024

but the drone connect with QGC work fine, include check battery status and takeoff ...whats the different?

@JonasVautherin
Copy link
Collaborator

i try to find out how to set message rate

https://github.com/mavlink/MAVSDK-Proto/blob/main/protos/telemetry/telemetry.proto#L100

but the drone connect with QGC work fine, include check battery status and takeoff ...whats the different?

I guess QGC sets the rate for Ardupilot?

@julianoes
Copy link
Contributor

I guess QGC sets the rate for Ardupilot?

Yes it does.

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

No branches or pull requests

3 participants