Open angel-ayala opened 3 months ago
Apparently MAVLink is working fine, nevertheless there are some MAV_CMD_REQUEST_MESSAGE
that may need proper handlers.
Every time when I have the QGC and start RD, the app crash with the following exception.
The issue should be with the FTP transaction, according to MAVLink documention, requestMsgId 395 is [COMPONENT_INFORMATION](https://mavlink.io/en/messages/common.html#COMPONENT_INFORMATION)
which is a
Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE.
Apparently that FTP transaction done is being done with a null pointer, additionally the method appears as deprecated since 2022-04.
Any ideas how to solve it?
2024-07-29 15:43:05.568 10209-10637 MAVLinkReceiver sq.rogue.rosettadrone D MAV_CMD_REQUEST_MESSAGE -> requestMsgId=148
2024-07-29 15:43:06.614 10209-10637 MAVLinkReceiver sq.rogue.rosettadrone D MAV_CMD_REQUEST_MESSAGE -> requestMsgId=397
2024-07-29 15:43:07.637 10209-10637 MAVLinkReceiver sq.rogue.rosettadrone D MAV_CMD_REQUEST_MESSAGE -> requestMsgId=395
2024-07-29 15:43:08.663 10209-10637 AndroidRuntime sq.rogue.rosettadrone E FATAL EXCEPTION: Thread-191
Process: sq.rogue.rosettadrone, PID: 10209
java.lang.NullPointerException: Attempt to invoke virtual method 'void sq.rogue.rosettadrone.FTPManager.manage_ftp(com.MAVLink.common.msg_file_transfer_protocol)' on a null object reference
at sq.rogue.rosettadrone.MAVLinkReceiver.process(MAVLinkReceiver.java:521)
at sq.rogue.rosettadrone.MainActivity$GCSCommunicatorAsyncTask$Listener.run(MainActivity.java:1773)
Definetively a bug in the implementation.
Why is it using FTP? Maybe it's old custom code that shouldn't be there.
One of the previous authors of RD (@The1only) was doing some custom FTP operations, like uploading stats to a private FTP server.
His customizations should be removed from the main code and placed into the "AI9Tek" plugin (app/src/main/java/sq/rogue/rosettadrone/plugins/AI9Tek.java),
as I have done myself in the past.
The mentioned plugin is broken. I moved the code there only to make him easier to re-enable his customizations in case he needs them in the future.
The bug you described could be triggered by some leftovers of his customizations in MAVLINK commands that were not tested afterwards. If so, feel free to remove those customizations and insert them as comments in the "AI9Tek" plugin.
Good, I did understand how to move the code to the plugin file, because the lines are in the MAVLinkReceiver.java
file and not in the MainActivity.java
.
I commented those lines and added the response to some commands such as get home location.
Additionally, apparently when set the home location from QGC is not being updated on the drone since the QGC is not updated.
Accordingly to the DJI SDK is the FlightController
class which possess the setHomeLocation()
method, and the DroneModel
call the setHomeLocation from a FlightControllerInstance
class, I was thinking that can be related.
Other aspect is the ACK necessity after a command, I saw that is already implemented but is not always sent. I added in the setHomeLocation
method to prevent being notified by QGC that the commands did not obtained a response.
I still need to test during flying, If all goes fine I will create a PR.
I also found and fixed many of those missing ACKs. I don't remember if QGC and MAVSDK were 100% compatible regarding ACKs (I remember the implementations had some deviations, but I got them working fine for my use cases).
I already did some tests, and when I create a mission on QGC appears the uploading message in logcat but when slide the bar to start the mission, nothing happens after that. I will look more in depth to what is wrong, at first, should be something related to MAVLink only.
I already did some tests, and when I create a mission on QGC appears the uploading message in logcat but when slide the bar to start the mission, nothing happens after that. I will look more in depth to what is wrong, at first, should be something related to MAVLink only.
What DJI model?
I'm not sure if phantom 4 supports on-board missions.
I implemented and tested extensively the MissionManager
class to support off-board missions (handled by RD).
If your drone doesn't support on-board missions, you can enable the MissionManager
class by adding the model in the list of models (one line of code).
For more info, please search the issues and code by MissionManager
.
I don't exactly know if P4P supports on-board missions, but I was looking into the MAVLinkReceiver
class, there are some if related with the MissionManager
and check if current model supports on-board mission.
There is anyway to test the support of on-board missions? I accidentally already added the model to the list and enabled it.
When I upload the mission enters into MAVLinkReceiver
class's finalizeNewMission
method with all working fine, but after sliding the drone lifts and then nothing happens and, there is no movement nor error log.
After populating the missionItems
through mModel.missionManager.setMission
which method (must be) is called? I was thinking in check the method's flow calls first, I'm using the mission planner from QGC with just one coordinate.
Any thoughts on what could it be?
For onBoard, just don't use the MissionManager class. I couldn't test it though because I have a cheap mini.
On September 5, 2024 9:05:35 PM GMT-04:00, Angel Ayala @.***> wrote:
There is anyway to test the support of on-board missions? I accidentally already added the model to the list and enabled it. When I upload the mission enters into
MAVLinkReceiver
class'sfinalizeNewMission
method with all working fine, but after sliding the drone lifts and then nothing happens and, there is no movement nor error log.After populating the
missionItems
throughmModel.missionManager.setMission
which method (must be) is called? I was thinking in check the method's flow calls first, I'm using the mission planner from QGC with just one coordinate. Any thoughts on what could it be?-- Reply to this email directly or view it on GitHub: https://github.com/RosettaDrone/rosettadrone/issues/218#issuecomment-2332985130 You are receiving this because you commented.
Message ID: @.***>
Describe the bug
After source code compilation and installing RD, the APK crashed when after tap the Drone button. I changed two lines of code, and I was able to use it, however, I still facing some problems.
I already set the RD and QGC settings, and I can arm the drone from my smartphone and through QGC, nevertheless, no success with other MAVLINK commands. With QGC I can read some sensor data, but I can't send the home location or other MAVLINK related commands with success.
On the logcat from android studio, after open RD I get some some error log, then when I tap the Drone button I get other error messages.
When I start the DroneKit's python script to read the vehicle state, I can see the captured state until the armed info, after that, the script keeps waiting set the home location command, which never happens.
There are some LDM related error, but on the DJI's site appears that is not mandatory, maybe because is a chinese smartphone? I don't know, can you help me?
Steps To Reproduce
case PHANTOM_4_PRO:
in theMainActivity.java
file at line 949, and update the line 296 ofDroneModel.java
withuseMissionManager = m_model == Model.PHANTOM_4_PRO
.Screenshots
No response
Drone Model
Smartphone Model
Additional context
DroneKit
python vehicle_state.py --connect udpin:0.0.0.0:14550
command output:RD start log output:
log after tap Drone button