I found that when I did this, the specific mission item wasn't being updated. It wasn't even sending the mission item at all. In any case, I had to call a function like .add(command_drone[2]) and then upload to update the mission item properly. However, this approach was adding an extra mission item to the end of the mission.
To address this issue, I started looking into the library's code and realized that there isn't a direct function to update a mission item. As a temporary solution, I added the following function:
'''
When you want to change the mission command only, use this function before upload.
'''
self.wait_ready()
self._vehicle._wpts_dirty = True
This function sets the self._vehicle._wpts_dirty variable to True, even if you don't add any commands, allowing you to execute the .upload() function without using the .add() function. I'm not sure if this is a correct solution. Can you confirm if this is a valid approach, or suggest an alternative solution?
Hello friends, the other day while working with DroneKit, I noticed that I couldn't update a specific mission item. For example:
I found that when I did this, the specific mission item wasn't being updated. It wasn't even sending the mission item at all. In any case, I had to call a function like .add(command_drone[2]) and then upload to update the mission item properly. However, this approach was adding an extra mission item to the end of the mission.
To address this issue, I started looking into the library's code and realized that there isn't a direct function to update a mission item. As a temporary solution, I added the following function:
This function sets the self._vehicle._wpts_dirty variable to True, even if you don't add any commands, allowing you to execute the .upload() function without using the .add() function. I'm not sure if this is a correct solution. Can you confirm if this is a valid approach, or suggest an alternative solution?