carla中的manual_control

世界构造与重启,天气同步与渲染,最后需销毁

class World(object):  

    __init__()

    restart()

    next_weather()

    toggle_radar()

    tick()

    render()

    destroy_sensors()

   destroy()

 

KeyboardControl  DualControl

键盘或者joystick控制,解析各种事件(parse_event, parse_vehicle_wheel)

 

HUD  世界同步、车辆信息同步

触发信息、通知、渲染

class HUD(object):

__init__()

on_world_tick()

tick()

toggle_info()

notification()

render()

 

传感器类:

IMU/Collision/LaneInvasion/Gnss/Radar等

摄像头管理类,包含rgb/depth/semantic_segmentation/lidar/dvs(Dynamic Vision Sensor)等传感器

 

碰撞类的属性为一个碰撞强度列表,行为为get_collision_history()

碰撞历史,包含帧和碰撞强度的键值对

当前帧前200帧内的可能碰撞强度列表,列出其200帧内的所有碰撞值

colhist = world.collision_sensor.get_collision_history()

collision = [colhist[x + self.frame - 200] for x in range(0, 200)]

 

GNSS应该包含时间、经纬度与海拔,但是这里只有lat、lon两个属性。

IMU包含accelerometer,gyroscope,compass三个属性。

 

设置传感器的值

bp = world.get_blueprint_library().find('sensor.other.radar')

bp.set_attribute('horizontal_fov', str(35))    #为什么是str?

bp.set_attribute('vertical_fov', str(20))

bp.set_attribute('image_size_x', str(hud.dim[0]))   #即摄像头的角度与hud的显示角度相同

bp.set_attribute('image_size_y', str(hud.dim[1]))

 

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值