@ -19,7 +19,7 @@ parser.add_argument('--joystick', action='store_true')
parser . add_argument ( ' --town ' , type = str , default = ' Town04 ' )
parser . add_argument ( ' --town ' , type = str , default = ' Town04 ' )
parser . add_argument ( ' --spawn_point ' , dest = ' num_selected_spawn_point ' ,
parser . add_argument ( ' --spawn_point ' , dest = ' num_selected_spawn_point ' ,
type = int , default = 16 )
type = int , default = 16 )
parser . add_argument ( ' --cloudy ness ' , default = 0.1 , type = float )
parser . add_argument ( ' --cloudi ness ' , default = 0.1 , type = float )
parser . add_argument ( ' --precipitation ' , default = 0.0 , type = float )
parser . add_argument ( ' --precipitation ' , default = 0.0 , type = float )
parser . add_argument ( ' --precipitation_deposits ' , default = 0.0 , type = float )
parser . add_argument ( ' --precipitation_deposits ' , default = 0.0 , type = float )
parser . add_argument ( ' --wind_intensity ' , default = 0.0 , type = float )
parser . add_argument ( ' --wind_intensity ' , default = 0.0 , type = float )
@ -62,7 +62,7 @@ def cam_callback(image):
dat = messaging . new_message ( ' roadCameraState ' )
dat = messaging . new_message ( ' roadCameraState ' )
dat . roadCameraState = {
dat . roadCameraState = {
" frameId " : image . frame ,
" frameId " : image . frame ,
" image " : img . tostring ( ) ,
" image " : img . tobyte s ( ) ,
" transform " : [ 1.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , 1.0 ]
" transform " : [ 1.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , 1.0 ]
}
}
pm . send ( ' roadCameraState ' , dat )
pm . send ( ' roadCameraState ' , dat )
@ -118,7 +118,6 @@ def fake_driver_monitoring():
" faceDetected " : True ,
" faceDetected " : True ,
" isDistracted " : False ,
" isDistracted " : False ,
" awarenessStatus " : 1. ,
" awarenessStatus " : 1. ,
" isRHD " : False ,
}
}
pm . send ( ' driverMonitoringState ' , dat )
pm . send ( ' driverMonitoringState ' , dat )
@ -143,7 +142,7 @@ def go(q):
world_map = world . get_map ( )
world_map = world . get_map ( )
vehicle_bp = blueprint_library . filter ( ' vehicle.tesla.* ' ) [ 0 ]
vehicle_bp = blueprint_library . filter ( ' vehicle.tesla.* ' ) [ 1 ]
spawn_points = world_map . get_spawn_points ( )
spawn_points = world_map . get_spawn_points ( )
assert len ( spawn_points ) > args . num_selected_spawn_point , \
assert len ( spawn_points ) > args . num_selected_spawn_point , \
f ''' No spawn point { args . num_selected_spawn_point } , try a value between 0 and
f ''' No spawn point { args . num_selected_spawn_point } , try a value between 0 and
@ -167,12 +166,12 @@ def go(q):
blueprint . set_attribute ( ' image_size_y ' , str ( H ) )
blueprint . set_attribute ( ' image_size_y ' , str ( H ) )
blueprint . set_attribute ( ' fov ' , ' 70 ' )
blueprint . set_attribute ( ' fov ' , ' 70 ' )
blueprint . set_attribute ( ' sensor_tick ' , ' 0.05 ' )
blueprint . set_attribute ( ' sensor_tick ' , ' 0.05 ' )
transform = carla . Transform ( carla . Location ( x = 0.8 , z = 1.45 ) )
transform = carla . Transform ( carla . Location ( x = 0.8 , z = 1.13 ) )
camera = world . spawn_actor ( blueprint , transform , attach_to = vehicle )
camera = world . spawn_actor ( blueprint , transform , attach_to = vehicle )
camera . listen ( cam_callback )
camera . listen ( cam_callback )
world . set_weather ( carla . WeatherParameters (
world . set_weather ( carla . WeatherParameters (
cloudy ness = args . cloudy ness ,
cloudi ness = args . cloudi ness ,
precipitation = args . precipitation ,
precipitation = args . precipitation ,
precipitation_deposits = args . precipitation_deposits ,
precipitation_deposits = args . precipitation_deposits ,
wind_intensity = args . wind_intensity ,
wind_intensity = args . wind_intensity ,
@ -278,7 +277,7 @@ def go(q):
sm . update ( 0 )
sm . update ( 0 )
throttle_op = sm [ ' carControl ' ] . actuators . gas #[0,1]
throttle_op = sm [ ' carControl ' ] . actuators . gas #[0,1]
brake_op = sm [ ' carControl ' ] . actuators . brake #[0,1]
brake_op = sm [ ' carControl ' ] . actuators . brake #[0,1]
steer_op = sm [ ' controlsState ' ] . angleSteersDes # degrees [-180,180]
steer_op = sm [ ' controlsState ' ] . steeringAngleDesiredDeg # degrees [-180,180]
throttle_out = throttle_op
throttle_out = throttle_op
steer_out = steer_op
steer_out = steer_op