Revision dec96050
ID | dec96050c396868ccc91772c744b018566045537 |
Made libscout compile. Changed behavior.cpp to set motors to the same speed in order to test simulator code.
scout/libscout/manifest.xml | ||
---|---|---|
11 | 11 |
<depend package="std_msgs"/> |
12 | 12 |
<depend package="roscpp"/> |
13 | 13 |
<depend package="motors"/> |
14 |
<depend package="headlights"/> |
|
14 | 15 |
|
15 | 16 |
</package> |
16 | 17 |
|
scout/libscout/src/behavior.cpp | ||
---|---|---|
44 | 44 |
* \param argv The array of command line arguments |
45 | 45 |
**/ |
46 | 46 |
int main(int argc, char **argv){ |
47 |
/* Todo: Replace this tester code */ |
|
48 |
/* Creates a simple publisher/subscriber node to test simulator |
|
49 |
* for motors interface |
|
50 |
*/ |
|
51 |
|
|
52 |
/* Initialize ROS */ |
|
53 |
ros::init(argc, argv, "libscout"); |
|
54 |
/* Initialize Scout library */ |
|
47 | 55 |
init(LIB_ALL, argc, argv); |
48 |
/** \todo remove this test code **/ |
|
49 |
// motors_set(100, MOTOR_ALL); |
|
50 |
ROS_INFO("%d", motors_query(MOTOR_FL)); |
|
51 |
|
|
52 |
ROS_SPIN( |
|
56 |
|
|
57 |
/* Some nodehandle to something. I'd tell you what except its called n_ |
|
58 |
* so it wouldnt reflect in the rest of the code. |
|
59 |
*/ |
|
60 |
ros::NodeHandle n_; |
|
61 |
|
|
62 |
ros::Publisher motors_set = n_.advertise<motors::set_motors>("Stuff", 1000); |
|
63 |
|
|
64 |
ros::Rate loop_rate(10); |
|
65 |
|
|
66 |
while(ros::ok()){ |
|
67 |
motors::set_motors msg; |
|
68 |
|
|
69 |
/* Set message fields */ |
|
70 |
msg.fl_speed = 125; |
|
71 |
msg.bl_speed = 125; |
|
72 |
msg.fr_speed = 125; |
|
73 |
msg.br_speed = 125; |
|
74 |
msg.which = 0; |
|
75 |
msg.units = MOTOR_ABSOLUTE; |
|
76 |
|
|
77 |
/* publish */ |
|
78 |
motors_set.publish(msg); |
|
79 |
|
|
80 |
ros::spinOnce(); |
|
81 |
|
|
82 |
loop_rate.sleep(); |
|
83 |
} |
|
84 |
|
|
53 | 85 |
return 0; |
54 |
} |
|
86 |
} |
scout/scoutsim/src/sim_frame.cpp | ||
---|---|---|
45 | 45 |
|
46 | 46 |
std::string scouts[SCOUTSIM_NUM_SCOUTS] = |
47 | 47 |
{ |
48 |
"box-turtle.png", |
|
49 |
"robot-turtle.png", |
|
50 |
"sea-turtle.png", |
|
51 |
"diamondback.png", |
|
52 |
"electric.png" |
|
48 |
"scout.png" |
|
49 |
"scout_forreal.png" |
|
53 | 50 |
}; |
54 | 51 |
|
55 | 52 |
std::string images_path = ros::package::getPath("scoutsim")+"/images/"; |
Also available in: Unified diff