void subscriberCallback(const ros::SingleSubscriberPublisher& pub)
{
  test_roscpp::TestEmpty msg;
  for(int i = 0; i < g_msg_count; i++)
  {
    pub.publish(msg);
    ROS_INFO("published message %d", i);
  }
}
示例#2
0
void connectCallback(const ros::SingleSubscriberPublisher &pub, int msg_count, int min_size, int max_size)
{
  test_roscpp::TestArray msg;
  for(int i = 0; i < msg_count; i++)
  {
    msg.counter = i;
    int j = min_size + (int) ((max_size - min_size) * (rand() / (RAND_MAX + 1.0)));
    msg.float_arr.resize(j);
    ROS_INFO("published message %d (%d bytes)\n",
             msg.counter, ros::serialization::Serializer<test_roscpp::TestArray>::serializedLength(msg));
    pub.publish(msg);
  }
}
示例#3
0
void connect_compass_callback(const ros::SingleSubscriberPublisher& pub)
{
    std_msgs::Int8 msg;
    msg.data = get_compass();
    pub.publish(msg);
}
示例#4
0
void connect_odometry_callback(const ros::SingleSubscriberPublisher& pub)
{
    pack_pose(_q,_odom);
    pub.publish(_odom);
}