Gimbal tilt to first waypoint

AutoQuad AV/AP settings, gimbal & servo choices

Gimbal tilt to first waypoint

Postby GoFaster » Thu Sep 27, 2012 3:14 am

I think I might have figured out why the gimbal is tilting down on the way to the first waypoint in a mission that just comprises a few waypoints.
Example: Test 1 video in this post viewtopic.php?f=27&t=1097&start=20#p4950

In nav.c, voidInit() function, there are two default mission objects (why are they there anyway - a failsafe thing?).
'poiAltitude' determines the gimbal tilt angle, with 0 being no tilt.
According to the "Parameters in mission commands" in the wiki,
the only instance where poiAltitude is valid paramter is for Land (?).
Code: Select all
 // HOME
    navData.missionLegs[i].type = NAV_LEG_HOME;
    navData.missionLegs[i].targetRadius = 0.10f;
    navData.missionLegs[i].loiterTime = (uint32_t)0.0e6f;
    navData.missionLegs[i].poiAltitude = UKF_ALTITUDE;

    // land
    navData.missionLegs[i].type = NAV_LEG_LAND;
    navData.missionLegs[i].maxHorizSpeed = 1.0f;
    navData.missionLegs[i].poiAltitude = 0.0f;

In the same wiki page
Code: Select all
The orbit command has additional features; it will keep the heading (front of multirotor) pointed to the center and if the altitude of the point of interest and altitude of the AutoQuad is different, it will keep the camera gimbal tilted to the altitude of point of interest. This will provide a great way to circle around an object while keeping the camera pointed to the object.

But according to the table, there is no poiAltitude parameter, only poiHeading; which makes no sense for Orbit. :?

Anyway, when uploading missions via mavlink, when a waypoint is uploaded as the first object (WP0), it does not take poiAltitude as a parameter and does not overwrite the default poiAltitude=UKF-ALTITUDE value in the first element of the data structure. I think this is the reason for the gimbal tilt.
Same thing for WP1, but it's 0 (no tilt) so the gimbal returns to level.
Code: Select all
else if (wp->type == NAV_LEG_GOTO){
    if ( wp->relativeAlt == 1 ) {
        mavlink_msg_mission_item_send(MAVLINK_COMM_0, msg.sysid, MAV_COMP_ID_MISSIONPLANNER, seqId, MAV_FRAME_GLOBAL_RELATIVE_ALT, MAV_CMD_NAV_WAYPOINT, (navData.missionLeg == seqId) ? 1 : 0, 1, wp->targetRadius, wp->loiterTime/1000, wp->maxHorizSpeed, wp->poiHeading, wp->targetLat, wp->targetLon, wp->targetAlt);

- Felix
Posts: 355
Joined: Tue Jul 03, 2012 1:20 pm
Location: Connecticut, USA

Return to Camera & Gimbal support

Who is online

Users browsing this forum: No registered users and 1 guest