Dependents: mbed-os-example-mros2 example-mbed-mros2-sub-pose example-mbed-mros2-pub-twist example-mbed-mros2-mturtle-teleop
mros2_msgs/std_msgs/msg/int16.hpp@7:c80f65422d99, 2022-03-19 (annotated)
- Committer:
- smoritaemb
- Date:
- Sat Mar 19 09:23:37 2022 +0900
- Revision:
- 7:c80f65422d99
- Parent:
- 2:159877d749c2
Merge test_assortment_of_msgs branch.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
smoritaemb | 0:580aba13d1a1 | 1 | #include <string> |
smoritaemb | 0:580aba13d1a1 | 2 | |
smoritaemb | 0:580aba13d1a1 | 3 | namespace std_msgs |
smoritaemb | 0:580aba13d1a1 | 4 | { |
smoritaemb | 0:580aba13d1a1 | 5 | namespace msg |
smoritaemb | 0:580aba13d1a1 | 6 | { |
smoritaemb | 0:580aba13d1a1 | 7 | class Int16 |
smoritaemb | 0:580aba13d1a1 | 8 | { |
smoritaemb | 0:580aba13d1a1 | 9 | public: |
smoritaemb | 0:580aba13d1a1 | 10 | std::string getTypeName(); |
smoritaemb | 0:580aba13d1a1 | 11 | int16_t data; |
smoritaemb | 0:580aba13d1a1 | 12 | |
smoritaemb | 0:580aba13d1a1 | 13 | void copyToBuf(uint8_t *addrPtr) |
smoritaemb | 0:580aba13d1a1 | 14 | { |
smoritaemb | 0:580aba13d1a1 | 15 | memcpy(addrPtr, &data, 2); |
smoritaemb | 0:580aba13d1a1 | 16 | addrPtr += 2; |
smoritaemb | 0:580aba13d1a1 | 17 | } |
smoritaemb | 0:580aba13d1a1 | 18 | |
smoritaemb | 0:580aba13d1a1 | 19 | void copyFromBuf(const uint8_t *addrPtr) |
smoritaemb | 0:580aba13d1a1 | 20 | { |
smoritaemb | 0:580aba13d1a1 | 21 | memcpy(&data, addrPtr, 2); |
smoritaemb | 0:580aba13d1a1 | 22 | addrPtr += 2; |
smoritaemb | 0:580aba13d1a1 | 23 | } |
smoritaemb | 0:580aba13d1a1 | 24 | |
smoritaemb | 2:159877d749c2 | 25 | void memAlign(uint8_t *addrPtr){ |
smoritaemb | 2:159877d749c2 | 26 | return; |
smoritaemb | 2:159877d749c2 | 27 | } |
smoritaemb | 2:159877d749c2 | 28 | |
smoritaemb | 0:580aba13d1a1 | 29 | uint8_t getTotalSize() |
smoritaemb | 0:580aba13d1a1 | 30 | { |
smoritaemb | 0:580aba13d1a1 | 31 | return 2; |
smoritaemb | 0:580aba13d1a1 | 32 | } |
smoritaemb | 0:580aba13d1a1 | 33 | private: |
smoritaemb | 0:580aba13d1a1 | 34 | std::string type_name = "std_msgs::msg::dds_::Int16"; |
smoritaemb | 0:580aba13d1a1 | 35 | }; |
smoritaemb | 0:580aba13d1a1 | 36 | }//namspace msg |
smoritaemb | 0:580aba13d1a1 | 37 | }//namespace std_msgs |
smoritaemb | 0:580aba13d1a1 | 38 | |
smoritaemb | 0:580aba13d1a1 | 39 | namespace message_traits |
smoritaemb | 0:580aba13d1a1 | 40 | { |
smoritaemb | 0:580aba13d1a1 | 41 | |
smoritaemb | 0:580aba13d1a1 | 42 | template<> |
smoritaemb | 0:580aba13d1a1 | 43 | struct TypeName<std_msgs::msg::Int16*> { |
smoritaemb | 0:580aba13d1a1 | 44 | static const char* value() |
smoritaemb | 0:580aba13d1a1 | 45 | { |
smoritaemb | 0:580aba13d1a1 | 46 | return "std_msgs::msg::dds_::Int16_"; |
smoritaemb | 0:580aba13d1a1 | 47 | } |
smoritaemb | 0:580aba13d1a1 | 48 | }; |
smoritaemb | 0:580aba13d1a1 | 49 | |
smoritaemb | 0:580aba13d1a1 | 50 | } |