Ask Your Question

roskinetic's profile - activity

2020-03-04 17:23:29 -0500 received badge  Famous Question (source)
2020-01-25 23:42:34 -0500 received badge  Nice Question (source)
2020-01-22 07:18:47 -0500 asked a question libgcc_s.so.1 must be installed for pthread_cancel to work

libgcc_s.so.1 must be installed for pthread_cancel to work Hi, After catkin_make without any error, I am facing the fol

2020-01-22 07:18:30 -0500 received badge  Notable Question (source)
2020-01-22 07:16:12 -0500 asked a question libgcc_s.so.1 must be installed for pthread_cancel to work

libgcc_s.so.1 must be installed for pthread_cancel to work Hi, After catkin_make without any error, I am facing this er

2019-12-04 16:52:44 -0500 received badge  Famous Question (source)
2019-12-04 16:52:44 -0500 received badge  Notable Question (source)
2019-11-29 02:39:38 -0500 received badge  Famous Question (source)
2019-10-25 04:03:31 -0500 received badge  Notable Question (source)
2019-09-04 04:15:31 -0500 received badge  Popular Question (source)
2019-08-24 05:32:05 -0500 received badge  Famous Question (source)
2019-08-05 11:02:23 -0500 received badge  Famous Question (source)
2019-08-05 11:02:23 -0500 received badge  Notable Question (source)
2019-07-12 09:59:07 -0500 asked a question Rviz Status Warn: Scale of 0 in one of x/y/z

Rviz Status Warn: Scale of 0 in one of x/y/z Hi, I am getting a status warning message in Rviz. Although the scale of

2019-06-28 08:54:47 -0500 received badge  Notable Question (source)
2019-06-26 08:57:04 -0500 received badge  Famous Question (source)
2019-06-20 23:57:06 -0500 received badge  Notable Question (source)
2019-06-20 23:57:06 -0500 received badge  Popular Question (source)
2019-05-04 14:21:25 -0500 asked a question ZED ROS Wrapper: Found unsuitable version "9.2", but required is at least "10"

ZED ROS Wrapper: Found unsuitable version "9.2", but required is at least "10" Hi, I am having a problem when I am inst

2019-05-04 14:17:58 -0500 asked a question ZED ROS Wrapper: Found unsuitable version "9.2" but required is at least "10"

ZED ROS Wrapper: Found unsuitable version "9.2" but required is at least "10" Hi, I am having a problem when I am insta

2019-04-22 16:57:56 -0500 edited question Socketcan publish rate

Socketcan publish rate Hi, I am having this programming question: int main() { ... s = socket(PF_CAN, SOCK_RAW, CAN

2019-04-22 16:57:56 -0500 received badge  Editor (source)
2019-04-22 16:56:34 -0500 asked a question Socketcan publish rate

Socketcan publish rate Hi, I am having this programming question: int main() { ... s = socket(PF_CAN, SOCK_RAW, CAN_

2019-04-19 14:38:02 -0500 received badge  Popular Question (source)
2019-04-19 10:57:38 -0500 commented answer Loop through unbounded tracks array in radar_msgs/RadarTrackArray

Thank you very much! :)

2019-04-19 10:57:23 -0500 marked best answer Loop through unbounded tracks array in radar_msgs/RadarTrackArray

Hi,

I am having this programming problem:

void msgCallback(const radar_msgs::RadarTrackArray::ConstPtr& msg)
{
  for (int i=0; i < msg->tracks.size(); i++)
   {
      a.push_back(msg->tracks[i].track_id);
   }
}

int main(int argc, char** argv)
{
  ...
  ros::Subscriber radar_sub = nh.subscribe("/radarTrack",1000,msgCallback);
  ros::spin();
  return 0;
}

the topic "/radarTrack" publishes messages every 20ms and the tracks array is an unbounded array, that is, it gives different length of array at each frame. For example, msg->tracks.size() can be 420, 28, 128 and so on.. When the length of tracks array is large, the calculation time of for-loop could be larger than 20ms. In this case, Does the messages that are published by "/radarTrack" wait until the for-loop calculation is complete although its calculation time is larger than 20ms?

Any help will be much appreciated.

2019-04-19 09:30:42 -0500 commented answer Length of the tracks array in radar_msgs/RadarTrackArray

Your help is much appreciated. I didn't know the tracks array is unbounded and this is where I was confused although I w

2019-04-19 09:26:37 -0500 asked a question Loop through unbounded tracks array in radar_msgs/RadarTrackArray

Loop through unbounded tracks array in radar_msgs/RadarTrackArray Hi, I am having this programming problem: void msgCa

2019-04-18 16:36:32 -0500 commented answer Length of the tracks array in radar_msgs/RadarTrackArray

Thank you for your answer and sorry for the question related to c++. As this tracks is an unbounded array, it is not act

2019-04-18 16:12:45 -0500 marked best answer Length of the tracks array in radar_msgs/RadarTrackArray

Hi,

I'm having this programming problem in ROS.

I'm looping through the tracks array in radar_msgs/RadarTrackArray message and accessing its values. I'm using for-loop:

for (int i = 0; i < sizeof(msg->tracks)/sizeof(msg->tracks[0]); i++)

But this expression for getting the array length returns the value of 0 all the time, although the tracks contains different number of tracks. sizeof(msg->tracks) returns the value of 24 and sizeof(msg->tracks[0]) returns the value of 80 all the time.

How do I fix this to get correct array length?

2019-04-18 08:17:37 -0500 received badge  Popular Question (source)
2019-04-18 01:33:09 -0500 received badge  Student (source)
2019-04-17 17:56:00 -0500 asked a question Length of the tracks array in radar_msgs/RadarTrackArray

Length of the tracks array in radar_msgs/RadarTrackArray Hi, I'm having this programming problem in ROS. I'm looping t

2019-02-12 03:49:19 -0500 received badge  Famous Question (source)
2019-01-08 02:35:01 -0500 received badge  Popular Question (source)
2019-01-08 02:34:56 -0500 received badge  Popular Question (source)
2018-12-27 02:32:11 -0500 received badge  Notable Question (source)
2018-12-26 22:12:48 -0500 received badge  Notable Question (source)
2018-10-16 08:00:10 -0500 received badge  Popular Question (source)
2018-10-15 08:01:46 -0500 commented question Numbe of extracted messages is less than number of messages

Yes, rosbag info tells me that 4754 msgs are recorded. However, only 4065 are extracted.. Is there any delay-related is

2018-10-14 17:23:59 -0500 asked a question Numbe of extracted messages is less than number of messages

Numbe of extracted messages is less than number of messages Hi, I am new to ROS and need some help. I recorded 4754 mes

2018-10-06 09:00:01 -0500 received badge  Enthusiast
2018-10-05 08:54:57 -0500 received badge  Popular Question (source)
2018-10-04 14:05:53 -0500 asked a question Time Synchronization with data collected from multiple sensors

Time Synchronization with data collected from multiple sensors Hi, I am new to ROS and have a question about time synchr

2018-10-04 13:17:17 -0500 marked best answer can't synchronize Velodyne points with other PointCloud2 data

Hi, I am new to ROS and I need a help for time synchronization. When I synchronize Velodyne points with ZED Images, they are synchronized without any problem (I attached this working code below). But, when I synchronize Velodyne points with other PointCloud2 data which is published by a node that I created, the callback function in my code never get called. I think both have the same type of time header since they both are PointCloud2 but I don't know why the time synchronizer doesn't work in this case. I tried to use Approximate/Exact but none of them works. Please advise.

Working code.

ros::Publisher data1_pub;

ros::Publisher data2_pub;

void callback(const sensor_msgs::Image::ConstPtr& data1, const sensor_msgs::PointCloud2::ConstPtr& data2)
{
  ROS_INFO("Sync_Callback");

  data1_pub.publish(data1);

 data2_pub.publish(data2);

}

int main(int argc, char** argv)

{

  ros::init(argc, argv, "TimeSynchronizer");

  std::string data1_topic = "/zed/right/image_rect_color";

  std::string data2_topic = "/velodyne_points";

  ros::NodeHandle nh;

  message_filters::Subscriber<sensor_msgs::Image> data1_sub(nh, data1_topic, 1000);

  message_filters::Subscriber<sensor_msgs::PointCloud2> data2_sub(nh, data2_topic, 1000);

  data1_pub = nh.advertise<sensor_msgs::Image>("/synchronized" + data1_topic, 1000);

  data2_pub = nh.advertise<sensor_msgs::PointCloud2>("/synchronized" + data2_topic, 1000);

  TimeSynchronizer<Image, PointCloud2> sync(data1_sub, data2_sub,10);

   sync.registerCallback(boost::bind(&callback, _1, _2));

  ros::spin();

  return 0;

}

Not Working code.

ros::Publisher data1_pub;

ros::Publisher data2_pub;

void callback(const sensor_msgs::PointCloud2::ConstPtr& data1, const sensor_msgs::PointCloud2::ConstPtr& data2)
{

  ROS_INFO("Sync_Callback");

  data1_pub.publish(data1);

  data2_pub.publish(data2);

}

int main(int argc, char** argv)

{

  ros::init(argc, argv, "TimeSynchronizer");

  std::string data1_topic = "/velodyne_points";

  std::string data2_topic = "/chatter";

  ros::NodeHandle nh;

  message_filters::Subscriber<sensor_msgs::PointCloud2> data1_sub(nh, data1_topic, 1000);

  message_filters::Subscriber<sensor_msgs::PointCloud2> data2_sub(nh, data2_topic, 1000);

  data1_pub = nh.advertise<sensor_msgs::PointCloud2>("/synchronized" + data1_topic, 1000);

  data2_pub = nh.advertise<sensor_msgs::PointCloud2>("/synchronized" + data2_topic, 1000);

  TimeSynchronizer<PointCloud2, PointCloud2> sync(data1_sub, data2_sub,10);

   sync.registerCallback(boost::bind(&callback, _1, _2));

  ros::spin();

  return 0;
}

"talker" node which publishes PointCloud2 data to /chatter topic

int main (int argc, char **argv){

    ros::init(argc, argv, "talker");

    ros::NodeHandle n;

        ros::Publisher chatter_pub = n.advertise<sensor_msgs::PointCloud2>("chatter", 1000);

        ros::Rate loop_rate(30); 

        int speed = 100;

    int count = 0;

    while (ros::ok()){

                sensor_msgs::PointCloud2 msg;

                msg.height = speed;

                ROS_INFO("%d",msg.height);

        chatter_pub.publish(msg);

                ros::spinOnce(); 

        loop_rate.sleep();

        ++count;

    }

    return 0;

}