Displaying a single distance value from a sensor as a Laser_Scan on RVIZ
So i create a scan which is published with the values below.
scan = LaserScan() scan.header.stamp = rospy.Time.now() scan.header.frame_id = 'sensor_frame' scan.scan_time = 0 scan.range_max = 0.80 scan.range_min = 0.03 scan.angle_min = 0 scan.angle_max = 0 scan.ranges = [sensor_reading] * 1 #sensor_reading is in M scan.intensities = [1] * 1
I know the scan is published with the name base_scan
and when i check with rostopic echo /base_scan
the scan comes up with all the set values. I then try and view the scan in RVIZ which is successfully receiving the scans as the sequence is going up but not displaying them. The only reason i could think that could be causing this is my values for some of the scan variables are wrong. Does anyone know why I cant see the point marked in RVIZ?
Edit: could this have something to do with frames as my robot is in the real world.
Thanks in advance.
Asked by Dalecn on 2021-12-12 16:11:19 UTC
Comments
If the
sensor_frame
is not connected tomap
,odom
,base_link
, etc., usingstatic_transform_publisher
and setting its location tobase_link
will work.Also, it may not have been visualized if it was within the robot's footprint. It might be different if you increase
scan.range_max
or multiplysensor_reading
by 2.Asked by miura on 2021-12-13 20:25:25 UTC