Comments (19)
I had the same issues but I used some other work around by setting the takeoff height parameter, MIS_TAKEOFF_ALT
await drone.param.set_float_param("MIS_TAKEOFF_ALT", 20.0)
20.0 metres was the height in my case.
That should suffice for now.
from mavsdk-python.
Sorry for the delay @aydal, I've been a bit overwhelmed.
I'm thinking that you may actually contribute to that issue, as now you are familiar with gRPC from the PositionNED
PR :-).
If you look at SetTakeoffAltitude
:
grpc::Status SetTakeoffAltitude(
grpc::ServerContext* /* context */,
const rpc::action::SetTakeoffAltitudeRequest* request,
rpc::action::SetTakeoffAltitudeResponse* /* response */) override
{
if (request != nullptr) {
const auto requested_altitude = request->altitude();
_action.set_takeoff_altitude(requested_altitude);
}
return grpc::Status::OK;
}
You can see that response
is ignored. Which is wrong: we need to respond with an ActionResult
, as defined by the proto file.
SetMaximumSpeed
, in the same file, does it the right way:
grpc::Status SetMaximumSpeed(
grpc::ServerContext* /* context */,
const rpc::action::SetMaximumSpeedRequest* request,
rpc::action::SetMaximumSpeedResponse* response) override
{
if (request != nullptr) {
const auto requested_speed = request->speed();
mavsdk::Action::Result action_result = _action.set_max_speed(requested_speed);
if (response != nullptr) {
auto* rpc_action_result = new rpc::action::ActionResult();
rpc_action_result->set_result(
static_cast<rpc::action::ActionResult::Result>(action_result));
rpc_action_result->set_result_str(mavsdk::Action::result_str(action_result));
response->set_allocated_action_result(rpc_action_result);
}
}
return grpc::Status::OK;
}
i.e. SetMaximumSpeed
does put the ActionResult
into the response
.
Would you mind fixing SetTakeoffAltitude
such that it behaves correctly? That would be awesome 😎.
from mavsdk-python.
Hello Jonas,
Apologies for the late reply. Have built and checked the changes. Changes visible on PR
from mavsdk-python.
Which PR?
from mavsdk-python.
@aydal: Any news on that? I remember you worked on that but I lost track eventually 😕.
from mavsdk-python.
That works, of course, but the fix suggested above would be cleaner. It should not be difficult to fix, and I believe @aydal had it but just did not open a PR with it 😕.
from mavsdk-python.
Alright then, let me give it a shot.
from mavsdk-python.
@vizzbee: sure, it would be awesome!
I don't remember that PR or why it did not get merged. The easiest would probably be to open a PR specific to that bugfix, so that it is easier to merge it. If you do it along with a new feature, it will take more time to get merged 🙂.
from mavsdk-python.
Hi, has the bug been resolved? I tried to modify the takeoff altitude on takeoff example file and still get an error.
from mavsdk-python.
@siddux let me check. I see the last status here: mavlink/MAVSDK#958
from mavsdk-python.
I have updated the pull request. I hope that we can merge it soon now.
from mavsdk-python.
The PR has been merged, this should be fixed in the next release.
from mavsdk-python.
This issue is marked as closed, but it seems to still be an issue. I ran similar code as shown above, calling the set_takeoff_altitude() command as follows:
await drone.action.set_takeoff_altitude(5.0)
The code throws and invalid parameter exception but still sets the altitude value. I can confirm this by calling the get method and verify that it was in fact changed. I am running version 0.12.0 of mavsdk on a raspberry pi.
from mavsdk-python.
I am running version 0.12.0 of mavsdk on a raspberry pi.
@cryptik Can you try the latest version 1.4.0?
from mavsdk-python.
Sorry... I gave you the version I am running on locally on MacOS. I deploy remotely to RPi.. will check the version when I am back at the drone. Another question... for the Mac, it appears the latest version is 0.12.0? I have an M1... is that the latest version?
from mavsdk-python.
M1 is tricky as we don't have mavsdk_server
built in CI for it yet. See #319.
You can get try to get the latest with python -m pip --upgrade install mavsdk
from mavsdk-python.
Thanks, but worries.. there are other issues I have with the M1 and related libraries... so the remote build on RPi works fine. Will check the version and report back.
When I do the upgrade on the M1, it tells me the requirement is already met... for version 0.12.0. Seems consistent with what is discussed in #319.
from mavsdk-python.
Ok, I checked... on the RPi, I am using mavsdk 1.4.0 which I assumed had this problem corrected... but maybe not for the Pi. I currently catch the exception and then call the get function to confirm that it was actually changed.
from mavsdk-python.
That's odd. It definitely should have been fixed in 1.4.0. I will try to reproduce this.
from mavsdk-python.
Related Issues (20)
- 'System' object has no attribute 'channel',The gripper does not work properly. HOT 21
- get_entries() gets stuck HOT 8
- Error when trying to connect via serial HOT 4
- Manual control/offboard not working HOT 17
- goto_location() unsupported error HOT 3
- How to use Param_server and Action_server HOT 5
- health.is_global_position_ok with Ardupilot HOT 18
- handling ActionError HOT 2
- getting mavsdk version HOT 5
- RuntimeError: aclose(): asynchronous generator is already running
- System.connect with time out HOT 3
- Running mavsdk server on Windows HOT 4
- How to manual control
- Unable to start a mission a second time HOT 3
- How to detect offboard command completion HOT 3
- One `mavsdk_server`, multiple drones HOT 2
- install mavsdk on py zero HOT 6
- "import_qgroundcontrol_mission_from_string" function not parsing the altitude correctly HOT 1
- drone.info.get_version() INFORMATION_NOT_RECEIVED_YET HOT 8
- FILE_DOES_NOT_EXIST on calling the drone.ftp.list_directory() to fetch internal directories file HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mavsdk-python.