2 #ifdef COMPILE_ARRAY_CODE_RSOSSERIAL 10 #include <geometry_msgs/Pose.h> 11 #include <geometry_msgs/PoseArray.h> 17 DigitalOut
myled(LED1);
19 geometry_msgs::Pose sum_msg;
22 void messageCb(
const geometry_msgs::PoseArray& msg) {
23 sum_msg.position.x = 0;
24 sum_msg.position.y = 0;
25 sum_msg.position.z = 0;
26 for (
int i = 0;
i < msg.poses_length;
i++) {
27 sum_msg.position.x += msg.poses[
i].position.x;
28 sum_msg.position.y += msg.poses[
i].position.y;
29 sum_msg.position.z += msg.poses[
i].position.z;
void publish(const boost::shared_ptr< M > &message) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ros::Publisher p("adc",&adc_msg)
void messageCb(const std_msgs::Empty &toggle_msg)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)