osrf / vrx

Virtual RobotX (VRX) resources.
Apache License 2.0
436 stars 198 forks source link

Cannot find the lidar sensor by rostopic echo, already enable sensor in wamv_gazebo.urdf.xacro and launch file #430

Closed AlexWUrobot closed 2 years ago

AlexWUrobot commented 2 years ago

We use the latest vrx model and find that the lidar sensor doesn't work, even though we enable lidar sensor in launch file or xacro file. image

A similar issue happened in 2019. https://github.com/osrf/vrx/issues/160

caguero commented 2 years ago

Hi @AlexWUrobot , I can't reproduce this issue. I'm compiling the current master branch, and then:

roslaunch vrx_gazebo vrx.launch
roslaunch wamv_gazebo rviz_vrx.launch

And I see lidar measurements in RViz: laser_rviz

I can also echo the topic /wamv/sensors/lidars/lidar_wamv/points and get data.

Are you testing in a different way?

ayarst commented 2 years ago

I can confirm that I am having the same problem as @AlexWUrobot. I ran the exact same commands as you, @caguero :

roslaunch vrx_gazebo vrx.launch roslaunch wamv_gazebo rviz_vrx.launch rostopic echo /wamv/sensors/lidars/lidar_wamv/points

The last command returns:

WARNING: no messages received and simulated time is active. Is /clock being published?

image image

caguero commented 2 years ago

Could you describe your installation please?

ayarst commented 2 years ago

It is the master branch from 2 days ago

ayarst commented 2 years ago

I also used the updated urdf generation with the components consisting of:

1 GPS 1 IMU 3 VLP-16 lidars Thrusters in default configuration

When I run the command:

roslaunch vrx_gazebo vrx.launch urdf:=/home/username/my_wamv/my_wamv.urdf

I do not receive topics for the gps, imu, or lidar.

image image

AlexWUrobot commented 2 years ago

@caguero thank you very much for your reply. I try to type your launch command and check rostopic, but it only provide 2D lidar information like the below lines ''' rostopic info /wamv/sensors/lidars/lidar_wamv/points Type: sensor_msgs/LaserScan ''' Usually it should be like ''' Type: sensor_msgs/PointCloud2.msg ''' which a 3D lidar should provide.

ayarst commented 2 years ago

That is strange because when I run:

roslaunch vrx_gazebo vrx.launch
roslaunch wamv_gazebo rviz_vrx.launch
rostopic info /wamv/sensors/lidars/lidar_wamv/points

It says that the type is sensor_msgs/PointCloud2 just like it should be.

image

But I am still not receiving data from this topic.

EdisonPricehan commented 2 years ago

Make sure Velodyne 3d lidar ros simulator is installed on your computer: sudo apt install ros-noetic-velodyne-simulator

ayarst commented 2 years ago

@EdisonPricehan that solved the lidar problem, but I'm still not receiving GPS or IMU data. Do those have similar dependencies?

caguero commented 2 years ago

It should be ros-noetic-hector-gazebo-plugins.

ayarst commented 2 years ago

@caguero thank you. Now everything works for me.

Are those package installs included in the VRX setup documentation? If so, I apologize for not conducting a thorough enough search. If not, they should be added to the documentation. Thanks again!

caguero commented 2 years ago

They are :) Checkout the dependencies detailed in https://github.com/osrf/vrx/wiki/host_install_tutorial.

caguero commented 2 years ago

Please reopen if needed, it looks like this was a problem of not installing some of the dependencies.