#32 Rename ai_control to autopilot_control
This commit is contained in:
parent
0a951a7722
commit
033854d80f
|
@ -33,7 +33,7 @@ collision_pedestrians | float | Collision intensity with pedestrians.
|
|||
collision_other | float | General collision intensity (everything else but pedestrians and vehicles).
|
||||
intersection_otherlane | float | Percentage of the car invading other lanes.
|
||||
intersection_offroad | float | Percentage of the car off-road.
|
||||
ai_control | Control | Vehicle's AI control that would apply this frame.
|
||||
autopilot_control | Control | Vehicle's autopilot control that would apply this frame.
|
||||
|
||||
###### Transform
|
||||
|
||||
|
@ -67,10 +67,10 @@ rectangle) against the map image of the city. These images are generated in the
|
|||
editor and serialized for runtime use. You can find them too in the release
|
||||
package under the folder "RoadMaps".
|
||||
|
||||
###### AI control
|
||||
###### Autopilot control
|
||||
|
||||
The `ai_control` measurement contains the control values that the in-game AI
|
||||
would apply if it were controlling the vehicle.
|
||||
The `autopilot_control` measurement contains the control values that the in-game
|
||||
autopilot system would apply as if it were controlling the vehicle.
|
||||
|
||||
This is the same structure used to send the vehicle control to the server.
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ DESCRIPTOR = _descriptor.FileDescriptor(
|
|||
name='carla_server.proto',
|
||||
package='carla_server',
|
||||
syntax='proto3',
|
||||
serialized_pb=_b('\n\x12\x63\x61rla_server.proto\x12\x0c\x63\x61rla_server\"+\n\x08Vector3D\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\"b\n\tTransform\x12(\n\x08location\x18\x01 \x01(\x0b\x32\x16.carla_server.Vector3D\x12+\n\x0borientation\x18\x02 \x01(\x0b\x32\x16.carla_server.Vector3D\"x\n\x07Vehicle\x12*\n\ttransform\x18\x01 \x01(\x0b\x32\x17.carla_server.Transform\x12*\n\nbox_extent\x18\x02 \x01(\x0b\x32\x16.carla_server.Vector3D\x12\x15\n\rforward_speed\x18\x03 \x01(\x02\"{\n\nPedestrian\x12*\n\ttransform\x18\x01 \x01(\x0b\x32\x17.carla_server.Transform\x12*\n\nbox_extent\x18\x02 \x01(\x0b\x32\x16.carla_server.Vector3D\x12\x15\n\rforward_speed\x18\x03 \x01(\x02\"\x94\x01\n\x0cTrafficLight\x12*\n\ttransform\x18\x01 \x01(\x0b\x32\x17.carla_server.Transform\x12/\n\x05state\x18\x02 \x01(\x0e\x32 .carla_server.TrafficLight.State\"\'\n\x05State\x12\t\n\x05GREEN\x10\x00\x12\n\n\x06YELLOW\x10\x01\x12\x07\n\x03RED\x10\x02\"Q\n\x0eSpeedLimitSign\x12*\n\ttransform\x18\x01 \x01(\x0b\x32\x17.carla_server.Transform\x12\x13\n\x0bspeed_limit\x18\x02 \x01(\x02\"\xe5\x01\n\x05\x41gent\x12\n\n\x02id\x18\x01 \x01(\x07\x12(\n\x07vehicle\x18\x02 \x01(\x0b\x32\x15.carla_server.VehicleH\x00\x12.\n\npedestrian\x18\x03 \x01(\x0b\x32\x18.carla_server.PedestrianH\x00\x12\x33\n\rtraffic_light\x18\x04 \x01(\x0b\x32\x1a.carla_server.TrafficLightH\x00\x12\x38\n\x10speed_limit_sign\x18\x05 \x01(\x0b\x32\x1c.carla_server.SpeedLimitSignH\x00\x42\x07\n\x05\x61gent\"%\n\x11RequestNewEpisode\x12\x10\n\x08ini_file\x18\x01 \x01(\t\"G\n\x10SceneDescription\x12\x33\n\x12player_start_spots\x18\x01 \x03(\x0b\x32\x17.carla_server.Transform\"/\n\x0c\x45pisodeStart\x12\x1f\n\x17player_start_spot_index\x18\x01 \x01(\r\"\x1d\n\x0c\x45pisodeReady\x12\r\n\x05ready\x18\x01 \x01(\x08\"^\n\x07\x43ontrol\x12\r\n\x05steer\x18\x01 \x01(\x02\x12\x10\n\x08throttle\x18\x02 \x01(\x02\x12\r\n\x05\x62rake\x18\x03 \x01(\x02\x12\x12\n\nhand_brake\x18\x04 \x01(\x08\x12\x0f\n\x07reverse\x18\x05 \x01(\x08\"\x83\x04\n\x0cMeasurements\x12\x1a\n\x12platform_timestamp\x18\x01 \x01(\r\x12\x16\n\x0egame_timestamp\x18\x02 \x01(\r\x12J\n\x13player_measurements\x18\x03 \x01(\x0b\x32-.carla_server.Measurements.PlayerMeasurements\x12.\n\x11non_player_agents\x18\x04 \x03(\x0b\x32\x13.carla_server.Agent\x1a\xc2\x02\n\x12PlayerMeasurements\x12*\n\ttransform\x18\x01 \x01(\x0b\x32\x17.carla_server.Transform\x12,\n\x0c\x61\x63\x63\x65leration\x18\x03 \x01(\x0b\x32\x16.carla_server.Vector3D\x12\x15\n\rforward_speed\x18\x04 \x01(\x02\x12\x1a\n\x12\x63ollision_vehicles\x18\x05 \x01(\x02\x12\x1d\n\x15\x63ollision_pedestrians\x18\x06 \x01(\x02\x12\x17\n\x0f\x63ollision_other\x18\x07 \x01(\x02\x12\x1e\n\x16intersection_otherlane\x18\x08 \x01(\x02\x12\x1c\n\x14intersection_offroad\x18\t \x01(\x02\x12)\n\nai_control\x18\n \x01(\x0b\x32\x15.carla_server.ControlB\x03\xf8\x01\x01\x62\x06proto3')
|
||||
serialized_pb=_b('\n\x12\x63\x61rla_server.proto\x12\x0c\x63\x61rla_server\"+\n\x08Vector3D\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\"b\n\tTransform\x12(\n\x08location\x18\x01 \x01(\x0b\x32\x16.carla_server.Vector3D\x12+\n\x0borientation\x18\x02 \x01(\x0b\x32\x16.carla_server.Vector3D\"x\n\x07Vehicle\x12*\n\ttransform\x18\x01 \x01(\x0b\x32\x17.carla_server.Transform\x12*\n\nbox_extent\x18\x02 \x01(\x0b\x32\x16.carla_server.Vector3D\x12\x15\n\rforward_speed\x18\x03 \x01(\x02\"{\n\nPedestrian\x12*\n\ttransform\x18\x01 \x01(\x0b\x32\x17.carla_server.Transform\x12*\n\nbox_extent\x18\x02 \x01(\x0b\x32\x16.carla_server.Vector3D\x12\x15\n\rforward_speed\x18\x03 \x01(\x02\"\x94\x01\n\x0cTrafficLight\x12*\n\ttransform\x18\x01 \x01(\x0b\x32\x17.carla_server.Transform\x12/\n\x05state\x18\x02 \x01(\x0e\x32 .carla_server.TrafficLight.State\"\'\n\x05State\x12\t\n\x05GREEN\x10\x00\x12\n\n\x06YELLOW\x10\x01\x12\x07\n\x03RED\x10\x02\"Q\n\x0eSpeedLimitSign\x12*\n\ttransform\x18\x01 \x01(\x0b\x32\x17.carla_server.Transform\x12\x13\n\x0bspeed_limit\x18\x02 \x01(\x02\"\xe5\x01\n\x05\x41gent\x12\n\n\x02id\x18\x01 \x01(\x07\x12(\n\x07vehicle\x18\x02 \x01(\x0b\x32\x15.carla_server.VehicleH\x00\x12.\n\npedestrian\x18\x03 \x01(\x0b\x32\x18.carla_server.PedestrianH\x00\x12\x33\n\rtraffic_light\x18\x04 \x01(\x0b\x32\x1a.carla_server.TrafficLightH\x00\x12\x38\n\x10speed_limit_sign\x18\x05 \x01(\x0b\x32\x1c.carla_server.SpeedLimitSignH\x00\x42\x07\n\x05\x61gent\"%\n\x11RequestNewEpisode\x12\x10\n\x08ini_file\x18\x01 \x01(\t\"G\n\x10SceneDescription\x12\x33\n\x12player_start_spots\x18\x01 \x03(\x0b\x32\x17.carla_server.Transform\"/\n\x0c\x45pisodeStart\x12\x1f\n\x17player_start_spot_index\x18\x01 \x01(\r\"\x1d\n\x0c\x45pisodeReady\x12\r\n\x05ready\x18\x01 \x01(\x08\"^\n\x07\x43ontrol\x12\r\n\x05steer\x18\x01 \x01(\x02\x12\x10\n\x08throttle\x18\x02 \x01(\x02\x12\r\n\x05\x62rake\x18\x03 \x01(\x02\x12\x12\n\nhand_brake\x18\x04 \x01(\x08\x12\x0f\n\x07reverse\x18\x05 \x01(\x08\"\x8a\x04\n\x0cMeasurements\x12\x1a\n\x12platform_timestamp\x18\x01 \x01(\r\x12\x16\n\x0egame_timestamp\x18\x02 \x01(\r\x12J\n\x13player_measurements\x18\x03 \x01(\x0b\x32-.carla_server.Measurements.PlayerMeasurements\x12.\n\x11non_player_agents\x18\x04 \x03(\x0b\x32\x13.carla_server.Agent\x1a\xc9\x02\n\x12PlayerMeasurements\x12*\n\ttransform\x18\x01 \x01(\x0b\x32\x17.carla_server.Transform\x12,\n\x0c\x61\x63\x63\x65leration\x18\x03 \x01(\x0b\x32\x16.carla_server.Vector3D\x12\x15\n\rforward_speed\x18\x04 \x01(\x02\x12\x1a\n\x12\x63ollision_vehicles\x18\x05 \x01(\x02\x12\x1d\n\x15\x63ollision_pedestrians\x18\x06 \x01(\x02\x12\x17\n\x0f\x63ollision_other\x18\x07 \x01(\x02\x12\x1e\n\x16intersection_otherlane\x18\x08 \x01(\x02\x12\x1c\n\x14intersection_offroad\x18\t \x01(\x02\x12\x30\n\x11\x61utopilot_control\x18\n \x01(\x0b\x32\x15.carla_server.ControlB\x03\xf8\x01\x01\x62\x06proto3')
|
||||
)
|
||||
|
||||
|
||||
|
@ -610,7 +610,7 @@ _MEASUREMENTS_PLAYERMEASUREMENTS = _descriptor.Descriptor(
|
|||
is_extension=False, extension_scope=None,
|
||||
options=None),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='ai_control', full_name='carla_server.Measurements.PlayerMeasurements.ai_control', index=8,
|
||||
name='autopilot_control', full_name='carla_server.Measurements.PlayerMeasurements.autopilot_control', index=8,
|
||||
number=10, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
|
@ -629,7 +629,7 @@ _MEASUREMENTS_PLAYERMEASUREMENTS = _descriptor.Descriptor(
|
|||
oneofs=[
|
||||
],
|
||||
serialized_start=1376,
|
||||
serialized_end=1698,
|
||||
serialized_end=1705,
|
||||
)
|
||||
|
||||
_MEASUREMENTS = _descriptor.Descriptor(
|
||||
|
@ -680,7 +680,7 @@ _MEASUREMENTS = _descriptor.Descriptor(
|
|||
oneofs=[
|
||||
],
|
||||
serialized_start=1183,
|
||||
serialized_end=1698,
|
||||
serialized_end=1705,
|
||||
)
|
||||
|
||||
_TRANSFORM.fields_by_name['location'].message_type = _VECTOR3D
|
||||
|
@ -712,7 +712,7 @@ _AGENT.fields_by_name['speed_limit_sign'].containing_oneof = _AGENT.oneofs_by_na
|
|||
_SCENEDESCRIPTION.fields_by_name['player_start_spots'].message_type = _TRANSFORM
|
||||
_MEASUREMENTS_PLAYERMEASUREMENTS.fields_by_name['transform'].message_type = _TRANSFORM
|
||||
_MEASUREMENTS_PLAYERMEASUREMENTS.fields_by_name['acceleration'].message_type = _VECTOR3D
|
||||
_MEASUREMENTS_PLAYERMEASUREMENTS.fields_by_name['ai_control'].message_type = _CONTROL
|
||||
_MEASUREMENTS_PLAYERMEASUREMENTS.fields_by_name['autopilot_control'].message_type = _CONTROL
|
||||
_MEASUREMENTS_PLAYERMEASUREMENTS.containing_type = _MEASUREMENTS
|
||||
_MEASUREMENTS.fields_by_name['player_measurements'].message_type = _MEASUREMENTS_PLAYERMEASUREMENTS
|
||||
_MEASUREMENTS.fields_by_name['non_player_agents'].message_type = _AGENT
|
||||
|
|
|
@ -121,7 +121,7 @@ def run_carla_client(host, port, autopilot_on, save_images_to_disk, image_filena
|
|||
# enable autopilot by sending back this control to the
|
||||
# server. Here we will also add some noise to the steer.
|
||||
|
||||
control = measurements.player_measurements.ai_control
|
||||
control = measurements.player_measurements.autopilot_control
|
||||
control.steer += random.uniform(-0.1, 0.1)
|
||||
client.send_control(control)
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ def run_carla_client(args):
|
|||
|
||||
client.start_episode(player_start)
|
||||
|
||||
use_ai_control = (random.random() < 0.5)
|
||||
use_autopilot_control = (random.random() < 0.5)
|
||||
reverse = (random.random() < 0.2)
|
||||
|
||||
for frame in range(0, frames_per_episode):
|
||||
|
@ -73,8 +73,8 @@ def run_carla_client(args):
|
|||
images[0].save_to_disk(filename.format(episode, frame))
|
||||
|
||||
logging.debug('sending control...')
|
||||
control = measurements.player_measurements.ai_control
|
||||
if not use_ai_control:
|
||||
control = measurements.player_measurements.autopilot_control
|
||||
if not use_autopilot_control:
|
||||
control.steer = random.uniform(-1.0, 1.0)
|
||||
control.throttle = 0.3
|
||||
control.hand_brake = False
|
||||
|
|
|
@ -18,7 +18,7 @@ from carla.util import make_connection
|
|||
|
||||
|
||||
class _BasicTestBase(unit_tests.CarlaServerTest):
|
||||
def run_carla_client(self, carla_settings, number_of_episodes, number_of_frames, use_ai_control=None):
|
||||
def run_carla_client(self, carla_settings, number_of_episodes, number_of_frames, use_autopilot_control=None):
|
||||
with make_connection(CarlaClient, self.args.host, self.args.port, timeout=15) as client:
|
||||
logging.info('CarlaClient connected, running %d episodes', number_of_episodes)
|
||||
for _ in range(0, number_of_episodes):
|
||||
|
@ -35,8 +35,8 @@ class _BasicTestBase(unit_tests.CarlaServerTest):
|
|||
number_of_player_starts,
|
||||
number_of_frames)
|
||||
client.start_episode(player_start)
|
||||
if use_ai_control is None:
|
||||
use_ai_control = (random.random() < 0.5)
|
||||
if use_autopilot_control is None:
|
||||
use_autopilot_control = (random.random() < 0.5)
|
||||
reverse = (random.random() < 0.2)
|
||||
for _ in range(0, number_of_frames):
|
||||
logging.debug('reading measurements...')
|
||||
|
@ -47,8 +47,8 @@ class _BasicTestBase(unit_tests.CarlaServerTest):
|
|||
if len(images) != len(carla_settings._cameras):
|
||||
raise RuntimeError('received %d images, expected %d' % (len(images), len(carla_settings._cameras)))
|
||||
logging.debug('sending control...')
|
||||
control = measurements.player_measurements.ai_control
|
||||
if not use_ai_control:
|
||||
control = measurements.player_measurements.autopilot_control
|
||||
if not use_autopilot_control:
|
||||
control.steer = random.uniform(-1.0, 1.0)
|
||||
control.throttle = 0.3
|
||||
control.hand_brake = False
|
||||
|
@ -108,4 +108,4 @@ class LongEpisode(_BasicTestBase):
|
|||
def run(self):
|
||||
settings = CarlaSettings()
|
||||
settings.add_sensor(Camera('DefaultCamera'))
|
||||
self.run_carla_client(settings, 1, 2000, use_ai_control=True)
|
||||
self.run_carla_client(settings, 1, 2000, use_autopilot_control=True)
|
||||
|
|
|
@ -311,11 +311,11 @@ CarlaServer::ErrorCode CarlaServer::SendMeasurements(
|
|||
Set(player.collision_other, PlayerState.GetCollisionIntensityOther());
|
||||
Set(player.intersection_otherlane, PlayerState.GetOtherLaneIntersectionFactor());
|
||||
Set(player.intersection_offroad, PlayerState.GetOffRoadIntersectionFactor());
|
||||
Set(player.ai_control.steer, PlayerState.GetSteer());
|
||||
Set(player.ai_control.throttle, PlayerState.GetThrottle());
|
||||
Set(player.ai_control.brake, PlayerState.GetBrake());
|
||||
Set(player.ai_control.hand_brake, PlayerState.GetHandBrake());
|
||||
Set(player.ai_control.reverse, PlayerState.GetCurrentGear() < 0);
|
||||
Set(player.autopilot_control.steer, PlayerState.GetSteer());
|
||||
Set(player.autopilot_control.throttle, PlayerState.GetThrottle());
|
||||
Set(player.autopilot_control.brake, PlayerState.GetBrake());
|
||||
Set(player.autopilot_control.hand_brake, PlayerState.GetHandBrake());
|
||||
Set(player.autopilot_control.reverse, PlayerState.GetCurrentGear() < 0);
|
||||
|
||||
TArray<carla_agent> Agents;
|
||||
if (bSendNonPlayerAgentsInfo) {
|
||||
|
|
|
@ -139,7 +139,7 @@ extern "C" {
|
|||
/** Percentage of the car off-road. */
|
||||
float intersection_offroad;
|
||||
/** Vehicle's AI control that would apply this frame. */
|
||||
struct carla_control ai_control;
|
||||
struct carla_control autopilot_control;
|
||||
};
|
||||
|
||||
/* ======================================================================== */
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace server {
|
|||
player->set_collision_other(values.player_measurements.collision_other);
|
||||
player->set_intersection_otherlane(values.player_measurements.intersection_otherlane);
|
||||
player->set_intersection_offroad(values.player_measurements.intersection_offroad);
|
||||
Set(player->mutable_ai_control(), values.player_measurements.ai_control);
|
||||
Set(player->mutable_autopilot_control(), values.player_measurements.autopilot_control);
|
||||
// Non-player agents.
|
||||
message->clear_non_player_agents(); // we need to clear as we cache the message.
|
||||
for (auto &agent : agents(values)) {
|
||||
|
|
|
@ -111,7 +111,7 @@ message Measurements {
|
|||
float intersection_otherlane = 8;
|
||||
float intersection_offroad = 9;
|
||||
|
||||
Control ai_control = 10;
|
||||
Control autopilot_control = 10;
|
||||
}
|
||||
|
||||
uint32 platform_timestamp = 1;
|
||||
|
|
Loading…
Reference in New Issue