Revision 0121ead7
Added the ROS stack with the libscout, motors, and sonar packages to the reposititory, and associated files. There are probably still things missing. Libscout won't run properly, but it and motors will compile. Sonar is probably broken, but nothing depends on it yet, so this shouldn't be an issue.
scout/libscout/src/libscout.cpp | ||
---|---|---|
1 | 1 |
/** |
2 |
* Copyright (c) 2007 Colony Project
|
|
2 |
* Copyright (c) 2011 Colony Project
|
|
3 | 3 |
* |
4 | 4 |
* Permission is hereby granted, free of charge, to any person |
5 | 5 |
* obtaining a copy of this software and associated documentation |
... | ... | |
39 | 39 |
|
40 | 40 |
#include "libscout.h" |
41 | 41 |
|
42 |
/* Global objects */ |
|
43 |
ros::NodeHandle libscout_node; |
|
44 |
|
|
42 | 45 |
/** \todo Decide how to call user behaviors |
43 | 46 |
* I'm thinking that there be a function call in main that calls the "main" |
44 | 47 |
fn in the user behavior. However, their "main" function will not be called |
... | ... | |
52 | 55 |
user behavior, or any other package that works below the surface. |
53 | 56 |
**/ |
54 | 57 |
|
55 |
|
|
58 |
/*! |
|
59 |
* \brief LibScout. Primary library for interfacing behaviors with scout hw. |
|
60 |
* |
|
61 |
* This is the main function for libscout. It is run when the node starts and |
|
62 |
* starts the library. It calls init() which initializes the clients and |
|
63 |
* publishers/subscribers for the other parts of the library. |
|
64 |
* |
|
65 |
* \param argc The number of command line arguments (should be 1) |
|
66 |
* \param argv The array of command line arguments |
|
67 |
**/ |
|
56 | 68 |
int main(int argc, char **argv){ |
57 | 69 |
ros::init(argc, argv, "libscout"); |
58 | 70 |
|
59 | 71 |
init(LIB_ALL); |
60 | 72 |
/** \todo remove this test code **/ |
61 |
// motors_set(100, 0);
|
|
62 |
// ROS_INFO("%d", motors_query(0));
|
|
73 |
// motors_set(100, MOTOR_ALL);
|
|
74 |
ROS_INFO("%d", motors_query(MOTOR_FL));
|
|
63 | 75 |
|
64 | 76 |
return 0; |
65 | 77 |
} |
66 | 78 |
|
79 |
/*! |
|
80 |
* \brief Initializes modules in the libscout. |
|
81 |
* |
|
82 |
* Calls init functions for each module in libscout. |
|
83 |
* \param modules A bitmask of the modules that will be initialized. |
|
84 |
**/ |
|
67 | 85 |
int init(int modules){ |
86 |
/** \todo Copy this if for each module that gets added to the library */ |
|
68 | 87 |
if(modules & LIB_MOTORS){ |
69 | 88 |
libmotors_init(); |
70 | 89 |
} |
71 | 90 |
/** \todo Add other lib inits **/ |
72 | 91 |
return 0; |
73 | 92 |
} |
93 |
|
Also available in: Unified diff