aabs7 / pymavlink_tutorial

This repo contains basic drone mavlink command usage using pymavlink
11 stars 5 forks source link

When running mission_upload.py, the program will get stuck while importing msg.seq in a loop. #1

Open hopekkl123 opened 3 years ago

hopekkl123 commented 3 years ago

When running mission_upload.py, when entering the loop on line 69, execute 4 and then recv_match(type=['MISSION_REQUEST'], blocking=True) will continue to block, Unable to upload complete mission points.

aabs7 commented 3 years ago

Hello @hopekkl123 I am not able to recreate the error you have because the code works fine on my computer, and other computers that I have access to.
mission_upload

However, I have some questions.

Thank you.

hopekkl123 commented 3 years ago

hi @aabs7 Oh, I forgot to say, the environment I use is: python3.6 ubuntu system, then I am using mavlink to connect to udp:0.0.0.0:14550, and use jmavsim for simulation, The mavlink_message.py & read_parameters.py scripts can work normally, my mission comes from mission.txt in this example. the following is my output:

2021-01-19 14-17-08 的屏幕截图

aabs7 commented 3 years ago

May be the MISSION_REQUEST command is cleared. Are you using mission_upload.py without changing anything in the source code except for the udp port connection? May be sending data like this can help you. I've changed sending method a little bit while incorporating other MAVLINK messages.

hopekkl123 commented 3 years ago

As you said, I just modified the udp port simulation in load_mission.py, This is a screenshot of the code: 2021-01-20 17-46-30 的屏幕截图 Then, I used the examples in drone.py & example.py As in the above situation, the mission cannot be loaded into the drone, which bothers me a lot. In jamvsim, I can see that it is (WPM: IGN MISSION_COUNT: Busy, then Operation timeout) and the simulation will stop. I am a newbie to the mavlink protocol. 2021-01-20 17-50-15 的屏幕截图

2021-01-20 17-51-29 的屏幕截图

aabs7 commented 3 years ago

Hello @hopekkl123

The code in this repository works fine with ARDUPILOT. However, I see that you are using PX4. I checked the code with PX4 and like you said, mission_upload fails when uploading in PX4 autopilot. Here is the same error, on my computer, that you have.

issue

Thank you for pointing this out. I will figure this out and post updates in this issue.

Thank you