Quantcast

Waypoint API behavior

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Waypoint API behavior

yogi
Hi All
I am really frustrated with trying to understand and use the Waypoint API of the pelican, and in general the GPS mode.
Has anybody outside of Asctec ever succesfully used Waypoint behavior? I am really frustrated with the lack of documentation, or the availability of the source code (so that I can figure things out myself).

All I am trying to do is make the pelican goto a height, move 10 meters laterally, programatically, using the Waypoint API.
Could somebody please tell me what the sequence of commands should be, and exactly when should I be sending them?

- Once the pelican is on, and on the ground, I set it to RC to  GPS mode and turn serial communications on.
- I can turn the motors on and off using programatically, so I know it is at least responding to the CTRL_INPUT packets.
- Now is it ready to receive my waypoint packets? When I send it waypoint packets (with the >*>ws prefix command) I get the ACK but nothing happens.

- I  build the waypoint by disabling the ABS_COORDS(which I assume means that X,Y specify distance to move in mm, from current position), and enabling AUTOMATIC_GOTO.

Questions:
- When is the quadrotor ready to receive the waypoint commands? Can it be on the ground?
- RC controller needs to be in GPS mode and serial enabled, right?
- Does the quadrotor have to be hovering in the air before I can send it waypoint commands?
- If I want it to move 10 meters forward, do I just send it the >*>ws command, and the waypoint packet with Y=10000, X=0, properties=0x10 (AUTOMATICGOTO), other values as mentioned in the API?
- What does the height command refer to? Does it go to the specified height as computed by the IMU_CALCDATA, or the GPS_DATA?
- is height value in the waypoint packet also dependent on the ABS_COORDS property? i.e., is the specified height always absolute, or can it also be made relative?

- Once I send a waypoint packet, I start observing current_way packets.  I saw that CURRENT_WAY packet was showing me nr_of_waypoints=4, current_wp=0. In the previous post, where CURRENT_WAY was described, the comments say do not worry about these.  I am really confused here.
- If a waypoint command is being executed, and I send another waypoint command before the first one is done, will it stop the first command, and just start executing the second command?

Thank you.

-Yogi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Waypoint API behavior

MarkusAchtelik
Hi Yogi,

I unfortunately can't help you with the API, but for accepting waypoints, make sure your sticks are centered (also thrust, i.e. 0 climb rate). As far as I know, this is for safety reasons so that you can always interrupt flying to a waypoint with stick inputs.
The Pelican should be able to receive commands on the ground. However, be careful with the GPS position drifting. You should always enable GPS mode right before takeoff. If it was enabled for a longer time, position might have drifted away and the heli will try flying to its initial position during take off.

Best, Markus
________________________________
From: yogi [via asctec-users] [[hidden email]]
Sent: Tuesday, August 30, 2011 0:00
To: Achtelik Markus
Subject: Waypoint API behavior

Hi All
I am really frustrated with trying to understand and use the Waypoint API of the pelican, and in general the GPS mode.
Has anybody outside of Asctec ever succesfully used Waypoint behavior? I am really frustrated with the lack of documentation, or the availability of the source code (so that I can figure things out myself).

All I am trying to do is make the pelican goto a height, move 10 meters laterally, programatically, using the Waypoint API.
Could somebody please tell me what the sequence of commands should be, and exactly when should I be sending them?

- Once the pelican is on, and on the ground, I set it to RC to  GPS mode and turn serial communications on.
- I can turn the motors on and off using programatically, so I know it is at least responding to the CTRL_INPUT packets.
- Now is it ready to receive my waypoint packets? When I send it waypoint packets (with the >*>ws prefix command) I get the ACK but nothing happens.

- I  build the waypoint by disabling the ABS_COORDS(which I assume means that X,Y specify distance to move in mm, from current position), and enabling AUTOMATIC_GOTO.

Questions:
- When is the quadrotor ready to receive the waypoint commands? Can it be on the ground?
- RC controller needs to be in GPS mode and serial enabled, right?
- Does the quadrotor have to be hovering in the air before I can send it waypoint commands?
- If I want it to move 10 meters forward, do I just send it the >*>ws command, and the waypoint packet with Y=10000, X=0, properties=0x10 (AUTOMATICGOTO), other values as mentioned in the API?
- What does the height command refer to? Does it go to the specified height as computed by the IMU_CALCDATA, or the GPS_DATA?
- is height value in the waypoint packet also dependent on the ABS_COORDS property? i.e., is the specified height always absolute, or can it also be made relative?

- Once I send a waypoint packet, I start observing current_way packets.  I saw that CURRENT_WAY packet was showing me nr_of_waypoints=4, current_wp=0. In the previous post, where CURRENT_WAY was described, the comments say do not worry about these.  I am really confused here.
- If a waypoint command is being executed, and I send another waypoint command before the first one is done, will it stop the first command, and just start executing the second command?

Thank you.

-Yogi


________________________________
If you reply to this email, your message will be added to the discussion below:
http://asctec-users.986163.n3.nabble.com/Waypoint-API-behavior-tp3293877p3293877.html
To start a new topic under asctec-users, email [hidden email]
To unsubscribe from asctec-users, click here<
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Waypoint API behavior

Jeroen.van.Emden
In reply to this post by yogi
With the following code I have got established waypoint control for the Pelican.
struct WAYPOINT {
    // always set to 1
    unsigned char wp_number;

    // don't care
    unsigned char dummy_1;
    unsigned short dummy_2;

    // see WPPROP defines below
    unsigned char properties;

    // max. speed to travel to waypoint in % (default 100)
    unsigned char max_speed;

    // time to stay at a waypoint (XYZ) in 1/100th s
    unsigned short time;

    // position accuracy to consider a waypoint reached in mm (default: 2500 (= 2.5 m))
    unsigned short pos_acc;

    // chksum = 0xAAAA + wp.yaw + wp.height + wp.time + wp.X + wp.Y + wp.max_speed + wp.pos_acc + wp.properties + wp.wp_number;
    short chksum;

    // waypoint coordinates longitude: -absolute: deg*10^7; -relative: mm;
    int X;
    // waypoint coordinates latitude: -absolute: deg*10^7; -relative: mm;
    int Y;
    // Desired heading at waypointv 1/1000 degree, i.e. 1 deg = 1000
    int yaw;
    // height over 0 reference in mm
    int height;
};

// Your wpt coordinates should be in 1 km range of your home point

telemetry_->sendWAYPOINT_.wp_number  = 1;               // Should always be one
telemetry_->sendWAYPOINT_.properties = 0x17;			// Absolute coordinates, direct goto, new height, new yaw angle

// WPT send function

unsigned char cmd[] = ">*>ws";

// Summit the way point
output(cmd, 5);
output((unsigned char*) &telemetry->sendWAYPOINT_, sizeof(telemetry->sendWAYPOINT_) );
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Waypoint API behavior

yogi
In reply to this post by MarkusAchtelik
Thank you Markus for your suggestion.
There was some communication problem in my code, which made it work on the bench, but not in the field. I was able to fix it, and as a result was able to make the Pelican move around today.


But as you pointed out, GPS drift is currently the biggest problem for me being able to program full autonomy. Once in a while, the robot just startes going at high speed in a direction. I think the problem can easily be fixed if the autopilot did some kind of filtering of the GPS signal, however as I understand, that is not possible with the current design.


-Yogi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Waypoint API behavior

tarek
In reply to this post by Jeroen.van.Emden
Can you explain a bit more about the code you sent? Can you share a bit more of your code? I'm confused about how to send the waypoint and also how to set it to fly at a certain height.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Waypoint API behavior

tarek
In reply to this post by Jeroen.van.Emden
also what is the message topic used to send waypoints?
Loading...