lgsvl / simulator

A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Other
2.29k stars 780 forks source link

echo lidar data #176

Closed ErijBNT closed 5 years ago

ErijBNT commented 5 years ago

when I run rostopic echo of the lidar topic I don't get the data. Why is that? The lidar sensor is enabled in the simulator. Screenshot from 2019-05-28 11-02-45 Screenshot from 2019-05-28 12-02-24

martins-mozeiko commented 5 years ago

Can you explain more - what are you running? Which map and vehicle are you selecting?

It seems that simulator is sending lidar data, but it has no points detected... Where is vehicle on the map positioned?

ErijBNT commented 5 years ago

@martins-mozeiko I am using the lgsvl vehicle and the San Francisco city. Thel idar sensor is enabled and I can visualise the points in the simulator when enabling the sensor effects.

martins-mozeiko commented 5 years ago

LGSVL vehicle expects ROS2 bridge & ROS2 environment. You are running rviz from ROS2, right?

ErijBNT commented 5 years ago

@martins-mozeiko No I am running it from ros1. In fact, I was able to get the pictures saved such as the lane following project but ina ros 1 environment

martins-mozeiko commented 5 years ago

Depending on message type some messages are exactly same between ROS1 and ROS2. But some messages are formatted differently in rosbridge protocol. You need to use ROS2 bridge and ROS2 environment if you want to use LGSVL vehicle.

ErijBNT commented 5 years ago

@martins-mozeiko Well, I used the ROS 2 environment but the rosbridge doesn't transport images. I always get black pictures while trying to save it how can I save images through the bridge?

martins-mozeiko commented 5 years ago

Simulator supports sending images over ROS2 just fine. This is how our lanefollowing project gets the image - check the video. You'll see captured image displayed in new window (by ROS2) node.

How exactly are you capturing image? Note that we are always sending jpeg compressed image, so you might need to decompress it if you want RGB values.

ErijBNT commented 5 years ago

@martins-mozeiko I did the same as the lane following project but the images are black

martins-mozeiko commented 5 years ago

Please check if there are any errors in output when docker container runs. And check logfile for Simulator (it is in ~/.config/unity3d/LG Silicon Valley Lab/Automotive Simulator/Player.log location).

ErijBNT commented 5 years ago

Thank you for your help. I have another question I don't if is it feasible. Can I process the data in real time and apply object classification and labelling and observe it in the simulator so that the vehicle can detect traffic lights

martins-mozeiko commented 5 years ago

This kind of detection is happening already now in Apollo or Autoware. They are receiving images over ROS or Cyber, doing detection real-time, and using result to control the vehicle so you can see whether it moves or not in simulator.

ErijBNT commented 5 years ago

Hello, I faced the same problem and using ros2 Screenshot from 2019-05-29 04-49-32

martins-mozeiko commented 5 years ago

Have you tried writing ros2 node that uses this lidar topic to actually see if there is any data? Maybe "ros2 topic echo" does not want to output large binary data to terminal?

When I'm using ros2 ardent version then it shows this:

data: !!binary ""

But the data is still there.

ErijBNT commented 5 years ago

@martins-mozeiko When I run ros 2 topic echo for the apollo vehicle There is an output. And the data shows

martins-mozeiko commented 5 years ago

Is there anything is bridge output? warnings/errors?

What about in log file for simulator?

ErijBNT commented 5 years ago

@martins-mozeiko There is no errors of the output of the bridge. and this is the player.log file Player.log

martins-mozeiko commented 5 years ago

You're right. we have a bug for ROS2. You can fix it by removing this line: https://github.com/lgsvl/simulator/blob/master/Assets/Scripts/LidarSensor/LidarSensor.cs#L618 And putting following two lines there instead:

Array = RosPointCloud,
Length = count * 32,
ErijBNT commented 5 years ago

Thanks a lot! it works now. Screenshot from 2019-05-30 22-24-31