Checking sensors
Index
Using RLIDAR
To use the lidar we have to write this line in the main:
1
2
3
4
5
6
def main(scenarios, headless, num_episodes, max_episode_steps=None):
agent_interface = AgentInterface(
action=ActionSpaceType.Direct,
max_episode_steps=max_episode_steps,
lidar_point_cloud=True,
)
Now to extract the lidar information we will use the dictionary:
1
observation['lidar_point_cloud']
This dictionary contains several variables (arrays) containing laser information, the one we are interested in now is ['point_cloud']
, which contains an unfiltered point cloud.
Sensor measurements
At first I didn’t understand how the point cloud was working as I thought it was more of a two-dimensional array without taking into account the height of the detections, the problem is that the point cloud is three-dimensional (I don’t know if there are such lasers on the market).
To better understand the laser measurements I took a random measurement and I used matplotlib to visualise it in 3D.
All the laser measurements are created from the car x,y position and z = 1.0.
Image of car position.
Here is a picture with the raw point cloud.
Another essential variable is:
1
observation['ego_vehicle_state']['heading']
Which will help us to obtain the orientation of the car.