Example #1
0
from scenarioGenerator import ScenarioGenerator
import os
import lgsvl
from lgsvl.geometry import Transform, Vector
from lgsvl.utils import ObjectState
from lgsvl.agent import DriveWaypoint
from lgsvl.agent import WalkWaypoint
import math
import random
import copy
from scenario_params import *

### start the scenario generator and simulator
gen = ScenarioGenerator(sim_host_ip, sim_host_port, sim_map, ego_car_model,
                        ros_bridge_ip, ros_bridge_port, time_limit, time_scale)

### set ego's starting location
# gen.set_ego_state_absolute(x=10, y=0, z=0, yaw=0)
gen.set_ego_state_relative_map(forward=-0, right=-6.5, yaw=0)

# ### create obstacles
# # obstacle 1: add static npc relative to default ego start location in map frame
# obs1_state = copy.deepcopy(gen.default_ego_state)
# gen.set_state_relative_map(obs1_state, forward=-10, right=0, yaw=180)
# gen.add_static_npc(obs1_state, speed=0, isDrive=False)

# # obstacle 2: add static npc relative to current ego start location in map frame
# obs2_state = copy.deepcopy(gen.ego_state)
# gen.set_state_relative_map(obs2_state, forward=20, right=0, yaw=0)
# gen.add_static_npc(obs2_state, speed=0, isDrive=False)
Example #2
0
import math
import random
import copy

### global variables
sim_host_ip = "127.0.0.1"  # of your local machine running sim
sim_host_port = 8181
sim_map = "CubeTown"
ego_car_model = "Jaguar2015XE (Autoware)"  # Lexus2016RXHybrid (Autoware)
ros_bridge_ip = "127.0.0.1"  # of the ros machine that runs the websocket_server
ros_bridge_port = 9090
time_limit = 0  # 0 means unlimited time otherwise sim will produce this much data in virtual seconds
time_scale = 1  # 1 means normal speed, 1.5 means 1.5x speed

### start the scenario generator and simulator
gen = ScenarioGenerator(sim_host_ip, sim_host_port, sim_map, ego_car_model,
                        ros_bridge_ip, ros_bridge_port, time_limit, time_scale)

### set ego's starting location
# gen.set_ego_state_absolute(x=10, y=0, z=0, yaw=0)
gen.set_ego_state_relative_map(forward=-0, right=-6.5, yaw=0)

# ### create obstacles
# # obstacle 1: add static npc relative to default ego start location in map frame
# obs1_state = copy.deepcopy(gen.default_ego_state)
# gen.set_state_relative_map(obs1_state, forward=-10, right=0, yaw=180)
# gen.add_static_npc(obs1_state, speed=0, isDrive=False)

# # obstacle 2: add static npc relative to current ego start location in map frame
# obs2_state = copy.deepcopy(gen.ego_state)
# gen.set_state_relative_map(obs2_state, forward=20, right=0, yaw=0)
# gen.add_static_npc(obs2_state, speed=0, isDrive=False)
Example #3
0
from scenarioGenerator import ScenarioGenerator
import os
import lgsvl
from lgsvl.geometry import Transform, Vector
from lgsvl.utils import ObjectState
from lgsvl.agent import DriveWaypoint
from lgsvl.agent import WalkWaypoint
import math
import random
import copy
from scenario_params import *

### start the scenario generator and simulator
gen = ScenarioGenerator(sim_host_ip, sim_host_port, sim_map, ego_car_model,
                        ros_bridge_ip, ros_bridge_port, time_limit, time_scale)

### set ego's starting location
# gen.set_ego_state_absolute(x=10, y=0, z=0, yaw=0)
gen.set_ego_state_relative_map(forward=-0, right=-6.50, yaw=0)

# ### create obstacles
# # obstacle 1: add static npc relative to default ego start location in map frame
# obs1_state = copy.deepcopy(gen.default_ego_state)
# gen.set_state_relative_map(obs1_state, forward=-10, right=0, yaw=180)
# gen.add_static_npc(obs1_state, speed=0, isDrive=False)

# # obstacle 2: add static npc relative to current ego start location in map frame
# obs2_state = copy.deepcopy(gen.ego_state)
# gen.set_state_relative_map(obs2_state, forward=20, right=0, yaw=0)
# gen.add_static_npc(obs2_state, speed=0, isDrive=False)
Example #4
0
from scenarioGenerator import ScenarioGenerator
import os
import lgsvl
from lgsvl.geometry import Transform, Vector
from lgsvl.utils import ObjectState
from lgsvl.agent import DriveWaypoint
from lgsvl.agent import WalkWaypoint
import math
import random
import copy
from scenario_params import *

### start the scenario generator and simulator
gen = ScenarioGenerator(sim_host_ip, sim_host_port, sim_map, ego_car_model,
                        ros_bridge_ip, ros_bridge_port, time_limit, time_scale)

### set ego's starting location
# gen.set_ego_state_absolute(x=10, y=0, z=0, yaw=0)
gen.set_ego_state_relative_map(forward=0, right=-6.5, yaw=0)

# ### create obstacles
# # obstacle 1: add static npc relative to default ego start location in map frame
# obs1_state = copy.deepcopy(gen.default_ego_state)
# gen.set_state_relative_map(obs1_state, forward=-10, right=0, yaw=180)
# gen.add_static_npc(obs1_state, speed=0, isDrive=False)

# # # obstacle 2: add static npc relative to current ego start location in map frame
# obs2_state = copy.deepcopy(gen.ego_state)
# gen.set_state_relative_map(obs2_state, forward=5, right=0, yaw=0)
# gen.add_static_npc(obs2_state, speed=0, isDrive=False)