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