From 1694228768c0d8d4de8b5d6936ca77420ac96700 Mon Sep 17 00:00:00 2001 From: Xisco Bosch Date: Mon, 29 May 2017 16:00:10 +0200 Subject: [PATCH] reverse and hand_brake are bool --- Source/CarlaServer/source/carla/CarlaServer.h | 4 ++-- .../CarlaServer/source/carla/server/CarlaCommunication.cpp | 6 +++--- Source/CarlaServer/source/carla/server/carla_protocol.proto | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/CarlaServer/source/carla/CarlaServer.h b/Source/CarlaServer/source/carla/CarlaServer.h index 9f010ac98..a2314cc6e 100644 --- a/Source/CarlaServer/source/carla/CarlaServer.h +++ b/Source/CarlaServer/source/carla/CarlaServer.h @@ -47,8 +47,8 @@ namespace carla { float steer; float gas; float brake; - float hand_brake; - float gear; + bool hand_brake; + bool gear; }; struct Reward_Values { diff --git a/Source/CarlaServer/source/carla/server/CarlaCommunication.cpp b/Source/CarlaServer/source/carla/server/CarlaCommunication.cpp index 48d7954ed..3f44066fe 100644 --- a/Source/CarlaServer/source/carla/server/CarlaCommunication.cpp +++ b/Source/CarlaServer/source/carla/server/CarlaCommunication.cpp @@ -199,8 +199,8 @@ namespace server { control_values.steer = 0.0f; control_values.gas = 0.0f; control_values.brake = 0.0f; - control_values.hand_brake = 0.0f; - control_values.gear = 0.0f; + control_values.hand_brake = false; + control_values.reverse = false; auto message = _clientThread.tryPop(); if (message == nullptr) { return false; } @@ -212,7 +212,7 @@ namespace server { control_values.gas = control.gas(); control_values.brake = control.brake(); control_values.hand_brake = control.hand_brake(); - control_values.gear = control.gear(); + control_values.reverse = control.reverse(); return true; } diff --git a/Source/CarlaServer/source/carla/server/carla_protocol.proto b/Source/CarlaServer/source/carla/server/carla_protocol.proto index 2fcefde0d..7a9803bbc 100644 --- a/Source/CarlaServer/source/carla/server/carla_protocol.proto +++ b/Source/CarlaServer/source/carla/server/carla_protocol.proto @@ -25,8 +25,8 @@ message Control { optional float steer = 1; optional float gas = 2; optional float brake = 3; - optional float hand_brake = 4; - optional float gear = 5; + optional bool hand_brake = 4; + optional bool reverse = 5; }