从娱乐角度上看已经能够实现地图切换和车辆的控制,但是,仿真环境的车辆在很多方面会与实际车辆不同,传感器的配置就属于这样的不同。
通过carla_ros_bridge_with_example_ego_vehicle.launch创建的Model3车辆模型,默认配置有激光雷达、摄像头、imu、gnss等。
这些传感器信息存放在carla_spawn_objects/config/obects.json
激光雷达默认安装在车顶,位于模型几何中心的。注意,Carla中传感器的安装位置都是相对于这个原点!
{
"type": "sensor.lidar.ray_cast",
"id": "lidar",
"spawn_point": {"x": 0.0, "y": 0.0, "z": 2.4, "roll": 0.0, "pitch": 0.0, "yaw": 0.0},
"range": 50,
"channels": 32,
"points_per_second": 320000,
"upper_fov": 2.0,
"lower_fov": -26.8,
"rotation_frequency": 20,
"noise_stddev": 0.0
}
所以,sensor.lidar.ray_cast的安装位置x=0,y=0。我们也可以根据需要增加激光雷达传感器。
{
"type": "sensor.lidar.ray_cast",
"id": "lidar_left",
"spawn_point": {"x": 2.469, "y": -1.025, "z": 0.8, "roll": 0.0, "pitch": 0.0, "yaw": 0.0},
"range": 50,
"channels": 32,
"points_per_second": 320000,
"upper_fov": 23.8,
"lower_fov": -2.0,
"rotation_frequency": 20,
"noise_stddev": 0.0
},
{
"type": "sensor.lidar.ray_cast",
"id": "lidar_right",
"spawn_point": {"x": 2.469, "y":1.025, "z": 0.8, "roll": 0.0, "pitch": 0.0, "yaw": 0.0},
"range": 50,
"channels": 32,
"points_per_second": 320000,
"upper_fov": 23.8,
"lower_fov": -2.0,
"rotation_frequency": 20,
"noise_stddev": 0.0
},
设置好安装位置的xyz参数,还有雷达的线数、fov等参数
新增加的传感器大概就在途中黑色圆圈中。
这个为确认是一个大坑,前面也介绍了车辆传感器的安装原点是车辆的几何中心!
{
"type": "sensor.other.gnss",
"id": "gnss",
"spawn_point": {"x": 1.0, "y": 0.0, "z": 2.0},
"noise_alt_stddev": 0.0, "noise_lat_stddev": 0.0, "noise_lon_stddev": 0.0,
"noise_alt_bias": 0.0, "noise_lat_bias": 0.0, "noise_lon_bias": 0.0
},
{
"type": "sensor.other.imu",
"id": "imu",
"spawn_point": {"x": 2.0, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0},
"noise_accel_stddev_x": 0.0, "noise_accel_stddev_y": 0.0, "noise_accel_stddev_z": 0.0,
"noise_gyro_stddev_x": 0.0, "noise_gyro_stddev_y": 0.0, "noise_gyro_stddev_z": 0.0,
"noise_gyro_bias_x": 0.0, "noise_gyro_bias_y": 0.0, "noise_gyro_bias_z": 0.0
},
这是默认的gnss和imu传感器的安装位置,并且还能支持噪声模拟……但是,是车上这个位置都是被映射到车辆后轴中心点!
{
"type": "sensor.other.gnss",
"id": "gnss",
"spawn_point": {"x": -1.369, "y": 0.0, "z": 2.0},
"noise_alt_stddev": 0.0, "noise_lat_stddev": 0.0, "noise_lon_stddev": 0.0,
"noise_alt_bias": 0.0, "noise_lat_bias": 0.0, "noise_lon_bias": 0.0
},
{
"type": "sensor.other.imu",
"id": "imu",
"spawn_point": {"x": -1.369, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0},
"noise_accel_stddev_x": 0.0, "noise_accel_stddev_y": 0.0, "noise_accel_stddev_z": 0.0,
"noise_gyro_stddev_x": 0.0, "noise_gyro_stddev_y": 0.0, "noise_gyro_stddev_z": 0.0,
"noise_gyro_bias_x": 0.0, "noise_gyro_bias_y": 0.0, "noise_gyro_bias_z": 0.0
},
如果不将传感器的位置映射到车辆后轴中心,当自动驾驶程序运行起来,Carla中的ego的轨迹跟踪效果就变差了!
欢迎关注
古德曼那汽车工业