Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def beamng():
beamng = BeamNGpy('localhost', 64256)
return beamng
def beamng():
beamng = BeamNGpy('localhost', 64256)
return beamng
def beamng():
beamng = BeamNGpy('localhost', 64256)
return beamng
def main():
beamng = BeamNGpy('localhost', 64256)
scenario = Scenario('GridMap', 'road_test')
road_a = Road('track_editor_C_center', rid='circle_road', looped=True)
nodes = [
(-25, 300, 0, 5),
(25, 300, 0, 6),
(25, 350, 0, 4),
(-25, 350, 0, 5),
]
road_a.nodes.extend(nodes)
scenario.add_road(road_a)
road_b = Road('track_editor_C_center', rid='center_road')
nodes = [
(0, 325, 0, 5),
(50, 375, 0, 5),
setup_logging()
# Plotting code setting up a 3x2 figure
fig = plt.figure(1, figsize=(10, 5))
axarr = fig.subplots(2, 3)
a_colour = axarr[0, 0]
b_colour = axarr[1, 0]
a_depth = axarr[0, 1]
b_depth = axarr[1, 1]
a_annot = axarr[0, 2]
b_annot = axarr[1, 2]
plt.ion()
beamng = BeamNGpy('localhost', 64256)
# Create a scenario in west_coast_usa
scenario = Scenario('west_coast_usa', 'research_test',
description='Random driving for research')
# Set up first vehicle, with two cameras, gforces sensor, lidar, electrical
# sensors, and damage sensors
vehicle = Vehicle('ego_vehicle', model='etk800',
licence='RED', color='Red')
# Set up sensors
pos = (-0.3, 1, 1.0)
direction = (0, 1, 0)
fov = 120
resolution = (512, 512)
front_camera = Camera(pos, direction, fov, resolution,
def main():
setup_logging()
beamng = BeamNGpy('localhost', 64256)
scenario = Scenario('west_coast_usa', 'lidar_tour',
description='Tour through the west coast gathering '
'Lidar data')
vehicle = Vehicle('ego_vehicle', model='etk800', licence='LIDAR')
lidar = Lidar()
vehicle.attach_sensor('lidar', lidar)
scenario.add_vehicle(vehicle, pos=(-717.121, 101, 118.675), rot=(0, 0, 45))
scenario.make(beamng)
bng = beamng.open(launch=True)
try:
bng.load_scenario(scenario)
window = open_window(SIZE, SIZE)
def main():
setup_logging()
beamng = BeamNGpy('localhost', 64256)
scenario = Scenario('west_coast_usa', 'ai_sine')
vehicle = Vehicle('ego_vehicle', model='etk800', licence='AI')
orig = (-769.1, 400.8, 142.8)
scenario.add_vehicle(vehicle, pos=orig, rot=(0, 0, 180))
scenario.make(beamng)
script = list()
for i in range(3600):
node = {
# Calculate the position as a sinus curve that makes the vehicle
# drive from left to right. The z-coordinate is not calculated in
# any way because `ai_set_script` by default makes the polyline to
# follow cling to the ground, meaning the z-coordinate will be