Skip to content
Snippets Groups Projects
Commit 11ca11c6 authored by sayanmitracode's avatar sayanmitracode
Browse files

adding comments in car models

parent ec12971e
No related branches found
No related tags found
No related merge requests found
# SM: Noting some things about the example
from dryvr_plus_plus.example.example_agent.car_agent import CarAgent, NPCAgent
from dryvr_plus_plus.example.example_agent.car_agent import CarAgent
from dryvr_plus_plus.scene_verifier.scenario.scenario import Scenario
......
# Example agent.
from typing import Tuple, List
import numpy as np
......@@ -23,6 +24,8 @@ class NPCAgent(BaseAgent):
return [x_dot, y_dot, theta_dot, v_dot]
def action_handler(self, mode, state, lane_map:LaneMap)->Tuple[float, float]:
''' Computes steering and acceleration based on current lane, target lane and
current state using a Stanley controller-like rule'''
x,y,theta,v = state
vehicle_mode = mode[0]
vehicle_lane = mode[1]
......
......@@ -62,7 +62,7 @@ class TestSimulatorMethods(unittest.TestCase):
self.car2 = CarAgent('other', file_name='example_controller1.py')
self.scenario.add_agent(self.car)
self.scenario.add_agent(self.car2)
# self.scenario.add_map(SimpleMap2())
self.scenario.add_map(SimpleMap2())
# self.scenario.set_sensor(FakeSensor1())
# self.scenario.set_init(
# [[0, 3, 0, 0.5]],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment