Revision 7a6ed02d
ID | 7a6ed02d47f49de02afc7e0e8cc97db92054f38c |
Major changes in mikrokopter for lost connection
-In nav_lib.cpp, added main_loop, so we don't have to keep rewriting it
:). Also, this now publishes to /mk_wrapper/control, which should be
used from now on. However, old publish_on still works as it did.
-Changed turn_to_target and joystick_control (but not any others yet) to
use new nav_lib main_loop.
-Added mk_wrapper, which simply copies messages from /mk_wrapper/control
to /mikrokopter/req_set_control. After recieving the first message, if
it receives no message for a period of 200ms (rosparam max_quiet_time),
it will instead publish 0's and a thrust of 60, ignoring all future
input until restarted.
-Added launch files onboard.launch and joystick.launch, so that we
remember what should run where and can easily set some parameters.
mikrokopter/src/turn_to_target.cpp | ||
---|---|---|
18 | 18 |
|
19 | 19 |
TurnToTarget::TurnToTarget() |
20 | 20 |
{ |
21 |
pub = n.advertise<mikrokopter::Control>("/mikrokopter/req_set_control", 100); |
|
21 |
//pub = n.advertise<mikrokopter::Control>("/mikrokopter/req_set_control", 100);
|
|
22 | 22 |
sub = n.subscribe<geometry_msgs::Point>("/v2v3_converter/target_3d", 100, |
23 | 23 |
&TurnToTarget::pointCallback, this); |
24 | 24 |
} |
25 | 25 |
|
26 | 26 |
void TurnToTarget::mainLoop() |
27 | 27 |
{ |
28 |
ros::Rate loop_rate(25); |
|
28 |
/*ros::Rate loop_rate(25);
|
|
29 | 29 |
while(ros::ok()) |
30 | 30 |
{ |
31 | 31 |
ros::spinOnce(); |
32 | 32 |
control.publish_on(pub); |
33 | 33 |
loop_rate.sleep(); |
34 |
} |
|
34 |
}*/ |
|
35 |
control.main_loop(); |
|
35 | 36 |
} |
36 | 37 |
|
37 | 38 |
void TurnToTarget::pointCallback(const geometry_msgs::Point::ConstPtr& p) |
Also available in: Unified diff