git.droids-corp.org
/
aversive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dcb7cd3
)
better orbiting
author
zer0
<zer0@carbon.local>
Sat, 9 Jan 2010 22:15:38 +0000
(23:15 +0100)
committer
zer0
<zer0@carbon.local>
Sat, 9 Jan 2010 22:15:38 +0000
(23:15 +0100)
modules/devices/robot/trajectory_manager/trajectory_manager_core.c
patch
|
blob
|
history
diff --git
a/modules/devices/robot/trajectory_manager/trajectory_manager_core.c
b/modules/devices/robot/trajectory_manager/trajectory_manager_core.c
index
a7473c4
..
cc2a58a
100644
(file)
--- a/
modules/devices/robot/trajectory_manager/trajectory_manager_core.c
+++ b/
modules/devices/robot/trajectory_manager/trajectory_manager_core.c
@@
-504,8
+504,10
@@
void trajectory_manager_circle_event(struct trajectory *traj)
* if we are far, go in the center direction,
* if we are at radius, we want to see the center at 90°
* if we are nearer than radius, angle to center is > 90° */
- if (v2pol_target.r > traj->target.circle.radius * 2)
- angle_to_center_rad = 0;
+ if (v2pol_target.r > traj->target.circle.radius) {
+ angle_to_center_rad = traj->target.circle.radius / v2pol_target.r;
+ angle_to_center_rad *= (M_PI / 2);
+ }
else {
angle_to_center_rad = 1. - (v2pol_target.r /
(2 * traj->target.circle.radius));