This program is porting rosserial_arduino for mbed http://www.ros.org/wiki/rosserial_arduino This program supported the revision of 169 of rosserial.
Dependents: rosserial_mbed robot_S2
ros/publisher.h@0:77afd7560544, 2011-08-19 (annotated)
- Committer:
- nucho
- Date:
- Fri Aug 19 09:06:30 2011 +0000
- Revision:
- 0:77afd7560544
- Child:
- 1:ff0ec969dad1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nucho | 0:77afd7560544 | 1 | /* |
nucho | 0:77afd7560544 | 2 | * publisher.h |
nucho | 0:77afd7560544 | 3 | * |
nucho | 0:77afd7560544 | 4 | * Created on: Aug 5, 2011 |
nucho | 0:77afd7560544 | 5 | * Author: astambler |
nucho | 0:77afd7560544 | 6 | */ |
nucho | 0:77afd7560544 | 7 | |
nucho | 0:77afd7560544 | 8 | #ifndef PUBLISHER_H_ |
nucho | 0:77afd7560544 | 9 | #define PUBLISHER_H_ |
nucho | 0:77afd7560544 | 10 | |
nucho | 0:77afd7560544 | 11 | #include "node_output.h" |
nucho | 0:77afd7560544 | 12 | |
nucho | 0:77afd7560544 | 13 | namespace ros{ |
nucho | 0:77afd7560544 | 14 | /* Generic Publisher */ |
nucho | 0:77afd7560544 | 15 | |
nucho | 0:77afd7560544 | 16 | class Publisher |
nucho | 0:77afd7560544 | 17 | { |
nucho | 0:77afd7560544 | 18 | public: |
nucho | 0:77afd7560544 | 19 | Publisher( const char * topic_name, Msg * msg ): topic_(topic_name), msg_(msg){}; |
nucho | 0:77afd7560544 | 20 | int publish( Msg * msg ){ |
nucho | 0:77afd7560544 | 21 | return no_->publish(id_, msg_); |
nucho | 0:77afd7560544 | 22 | }; |
nucho | 0:77afd7560544 | 23 | |
nucho | 0:77afd7560544 | 24 | const char * topic_; |
nucho | 0:77afd7560544 | 25 | |
nucho | 0:77afd7560544 | 26 | Msg *msg_; |
nucho | 0:77afd7560544 | 27 | int id_; |
nucho | 0:77afd7560544 | 28 | NodeOutput_* no_; |
nucho | 0:77afd7560544 | 29 | }; |
nucho | 0:77afd7560544 | 30 | |
nucho | 0:77afd7560544 | 31 | } |
nucho | 0:77afd7560544 | 32 | |
nucho | 0:77afd7560544 | 33 | |
nucho | 0:77afd7560544 | 34 | #endif /* PUBLISHER_H_ */ |