Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get lidar data in ROS2 #670

Closed
sjev opened this issue Nov 9, 2020 · 7 comments
Closed

Unable to get lidar data in ROS2 #670

sjev opened this issue Nov 9, 2020 · 7 comments

Comments

@sjev
Copy link

sjev commented Nov 9, 2020

After reading the documentation and hours of googling through issues (like this one), I'm still not able to read the lidar data published on /scan topic.

How to reproduce:

  1. bring up tutrtlebot
  2. start rqt on remote pc. -> there are no updates from the scan sensor (below is a screenshot from the emanual, showing unknown update frequency for the data. Nothing is coming in)
    img from manual
  3. check topic with ros2 topic echo /scan -> messages are being received
  4. subscribe from python sub = node.create_subscription( String, 'scan', chatter_callback, qos_profile=qos_profile_sensor_data) -> no messages

I'm at a loss here...

@sjev
Copy link
Author

sjev commented Nov 9, 2020

Ok, I did manage to get the data with this code, but the documentation could be a bit better.

  1 from rclpy.qos import qos_profile_sensor_data, QoSProfile
  2 from sensor_msgs.msg import LaserScan
  3 import rclpy
  4 
  5 def chatter_callback(msg):
  6     print(msg)
  7 
  8 def main():
  9     
 10     rclpy.init()
 11     qos = QoSProfile(depth=10)
 12     node = rclpy.create_node('scan_listener')
 13     sub = node.create_subscription(LaserScan,
 14                                    'scan',
 15                                    chatter_callback,
 16                                    qos_profile=qos_profile_sensor_data)
 17     try:
 18         while True:
 19             rclpy.spin_once(node)
 20 
 21     except KeyboardInterrupt:
 22         pass
 23 
 24 if __name__ == "__main__":
 25     print('Starting scan listener')
 26     main()
 27     print('done.')        

@ROBOTIS-David
Copy link
Contributor

ROBOTIS-David commented Nov 10, 2020

Ok, I did manage to get the data with this code, but the documentation could be a bit better.

  1 from rclpy.qos import qos_profile_sensor_data, QoSProfile
  2 from sensor_msgs.msg import LaserScan
  3 import rclpy
  4 
  5 def chatter_callback(msg):
  6     print(msg)
  7 
  8 def main():
  9     
 10     rclpy.init()
 11     qos = QoSProfile(depth=10)
 12     node = rclpy.create_node('scan_listener')
 13     sub = node.create_subscription(LaserScan,
 14                                    'scan',
 15                                    chatter_callback,
 16                                    qos_profile=qos_profile_sensor_data)
 17     try:
 18         while True:
 19             rclpy.spin_once(node)
 20 
 21     except KeyboardInterrupt:
 22         pass
 23 
 24 if __name__ == "__main__":
 25     print('Starting scan listener')
 26     main()
 27     print('done.')        

Hi @sjev, Thank you for reporting the issue :)

I would like to transfer this issue to the TurtleBot3 issue section.

One of our team member will address your issue as soons as possible.

Thank you,

@ROBOTIS-David ROBOTIS-David transferred this issue from ROBOTIS-GIT/emanual Nov 10, 2020
@ROBOTIS-Ashe
Copy link
Contributor

@sjev
Hi. @sjev
I'm sorry for the late reply.

I'will check this issue and get back to you.
Thank you for your patience

@ROBOTIS-Will
Copy link
Contributor

This is related to the ROS2 QoS setting.
In RViz2, setting Reliability Policy of LaserScan topic to "Best Effort" will draw LDS sensor data, but rqt seems not reflecting this change.
image

@ROBOTIS-Will
Copy link
Contributor

Closing this issue as there isn't recent activity. Please feel free to reopen when necessary.

@sjev
Copy link
Author

sjev commented Jan 31, 2021

"One of our team member will address your issue as soons as possible."

Please deliver on your promise instead of waiting for more than 2 months and then closing this thread due to your own inactivity.

@ROBOTIS-Will
Copy link
Contributor

Hi @sjev
Thank you for the reminder, and sorry about not informing the update on this.
The issue is mainly related to the QoS setting of rqt.
ros-visualization/rqt#187

The updated rviz setting was available in the latest TurtleBot3 package.
f6078c1
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants