3 #include "raspicat/LedValues.h" 7 void output(std::ofstream *ofs,
bool input)
9 *ofs << (input ?
'1' :
'0') << std::endl;
12 void cb(
const raspicat::LedValues::ConstPtr& msg)
14 std::ofstream ofs0(
"/dev/rtled0");
15 output(&ofs0, msg->right_side);
16 std::ofstream ofs1(
"/dev/rtled1");
17 output(&ofs1, msg->right_forward);
18 std::ofstream ofs2(
"/dev/rtled2");
19 output(&ofs2, msg->left_forward);
20 std::ofstream ofs3(
"/dev/rtled3");
21 output(&ofs3, msg->left_side);
25 int main(
int argc,
char **argv)
27 init(argc,argv,
"leds");
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ROSCPP_DECL void spin(Spinner &spinner)
int main(int argc, char **argv)
void output(std::ofstream *ofs, bool input)
void cb(const raspicat::LedValues::ConstPtr &msg)