Lucas13013 / javadrone

Automatically exported from code.google.com/p/javadrone
0 stars 0 forks source link

Rough calculation of values of movement in ControlTower #49

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Current calculation of values of movement is quite rough and vanishes all 
advantages of PS3 controllers (or other controllers that have joysticks).

For instance, when you use PS3 controller with control treshold 0.3 and 
max_euler_angle=0.3, move values will always exceed max_euler_angle (due to 
control treshold), so drone will cut them down to 0.3 of its maximum angle. 
This will lead to the situation when your PS3 joystick has only 5 values: 
center, left, right, up and down; but normally you would have a range of values 
(actually, -128..+128) for the precise controlling of the drone.

I hope, I have fixed this wrong calculation in attached patch.

Original issue reported on code.google.com by ayzen.q...@gmail.com on 27 Jan 2013 at 1:43

Attachments:

GoogleCodeExporter commented 8 years ago
Great idea but looks like that code is already doing this calculation.  

ARDrone.move(arg1, arg2, arg3, arg4) will generate AT*PCMD command that will be 
sent to drone. Arguments are mapped: arg1 - Argument 3, arg2 - Argument 4, arg3 
- Argument 5, arg4 - Argument 6.          

From ARDrone_Developer_Guide.pdf description of AT command:

AT*PCMD / AT*PCMD_MAG
Send progressive commands - makes the drone move (translate/rotate).
Summary : Send progressive commands - makes the drone move (translate/rotate).

Corresponding API function : ardrone_at_set_progress_cmd
Corresponding API function : ardrone_at_set_progress_cmd_with_magneto

     Syntax : AT*PCMD=%d,%d,%d,%d,%d,%d<CR>
     Syntax : AT*PCMD_MAG=%d,%d,%d,%d,%d,%d,%d,<CR>

Argument 1 : the sequence number
Argument 2 : flag enabling the use of progressive commands and/or the Com-
             bined Yaw mode (bitfield)
Argument 3 : drone left-right tilt - floating-point value in range [−1..1]
Argument 4 : drone front-back tilt - floating-point value in range [−1..1]
Argument 5 : drone vertical speed - floating-point value in range [−1..1]
Argument 6 : drone angular speed - floating-point value in range [−1..1]
Argument 7 : magneto psi (only for AT*PCMD_MAG) - floating-point value in
             range [−1..1]
Argument 8 : magneto psi accuracy (only for AT*PCMD_MAG) - floating-point
             value in range [−1..1]

Original comment by dshm...@codeminders.com on 28 Jan 2013 at 5:46

GoogleCodeExporter commented 8 years ago
I've changed the patch according to AR.Drone documentation and your comment.

Original comment by ayzen.q...@gmail.com on 29 Jan 2013 at 8:52

Attachments:

GoogleCodeExporter commented 8 years ago
Patch 2 is commited to central repository without any changes

Original comment by dshm...@codeminders.com on 31 Jan 2013 at 12:35