Publishing laser scan problem
I have a problem regarding publishing laser scan message. It is publishing but, rather, it works differently. The laser scan keeps on rotating pretty fast and it's normally shouldn't move so fast as the scan message doesn't have any other information like position and orientation. I'm willing to use only 90 degree of the middle region of the laser scan view/mirror. Perhaps, I've overlooked something that somebody could figure out. The laser scan data resides in a dataset file in which it starts from column of 10 to 1080.
while (n.ok() && (t < num_row))
{
scan.header.frame_id = "laser";
scan.angle_min = -45 * M_PI / 180; // -45 degree
scan.angle_max = 45 * M_PI / 180; // 45 degree
scan.angle_increment = 0.25 * M_PI/180.0;
scan.time_increment = (1 / laser_frequency) / (int)(90/0.25);
scan.range_min = 0.0;
scan.range_max = 30.0;
scan.ranges.resize((int)(90/0.25));
for(int i = 0; i < 360; ++i)
{
scan.ranges[i] = data_set[t][i+9+360] / 1000.0;
}
scan.header.stamp = ros::Time::now();
scan_pub.publish(scan);
}
Thanks in advance.
Asked by alfa_80 on 2012-02-03 01:53:51 UTC
Comments