3 #include "raspicat/LightSensorValues.h" 10 if(n->
getParam(
"frequency",f) and f > 0)
16 int main(
int argc,
char **argv)
18 init(argc,argv,
"lightsensors");
26 raspicat::LightSensorValues msg;
31 unsigned int old = freq;
35 ROS_INFO(
"Lightsensor frequency: %d", freq);
39 std::ifstream ifs(
"/dev/rtlightsensor0");
40 ifs >> msg.right_forward >> msg.right_side
41 >> msg.left_side >> msg.left_forward;
43 msg.sum_forward = msg.left_forward + msg.right_forward;
44 msg.sum_all = msg.sum_forward + msg.left_side + msg.right_side;
void publish(const boost::shared_ptr< M > &message) const
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int getFrequency(int old, NodeHandle *n)
int main(int argc, char **argv)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
bool getParam(const std::string &key, std::string &s) const
ROSCPP_DECL void spinOnce()