Rename get_vehicle_control to get_control to be consistent with walkers
This commit is contained in:
parent
656aba71ec
commit
aeecd3d6eb
|
@ -5,6 +5,7 @@
|
|||
* Added "sensor_tick" attribute to sensors (cameras and lidars) to specify the capture rate in seconds
|
||||
* Added "get_forward_vector()" to rotation and transform, retrieves the unit vector on the rotation's X-axis
|
||||
* Added support for Deepin in PythonAPI's setup.py
|
||||
* Rename vehicle.get_vehicle_control() to vehicle.get_control() to be consistent with walkers
|
||||
|
||||
## CARLA 0.9.2
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
|
||||
- `bounding_box`
|
||||
- `apply_control(vehicle_control)`
|
||||
- `get_vehicle_control()`
|
||||
- `get_control()`
|
||||
- `set_autopilot(enabled=True)`
|
||||
|
||||
## `carla.TrafficLight(carla.Actor)`
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace client {
|
|||
}
|
||||
}
|
||||
|
||||
Vehicle::Control Vehicle::GetVehicleControl() const {
|
||||
Vehicle::Control Vehicle::GetControl() const {
|
||||
return GetEpisode().Lock()->GetActorDynamicState(*this).state.vehicle_control;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace client {
|
|||
///
|
||||
/// @note This function does not call the simulator, it returns the Control
|
||||
/// received in the last tick.
|
||||
Control GetVehicleControl() const;
|
||||
Control GetControl() const;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -216,7 +216,7 @@ class KeyboardControl(object):
|
|||
self._control.gear = 1 if self._control.reverse else -1
|
||||
elif event.key == K_m:
|
||||
self._control.manual_gear_shift = not self._control.manual_gear_shift
|
||||
self._control.gear = world.vehicle.get_vehicle_control().gear
|
||||
self._control.gear = world.vehicle.get_control().gear
|
||||
world.hud.notification(
|
||||
'%s Transmission' % ('Manual' if self._control.manual_gear_shift else 'Automatic'))
|
||||
elif self._control.manual_gear_shift and event.key == K_COMMA:
|
||||
|
@ -284,7 +284,7 @@ class HUD(object):
|
|||
return
|
||||
t = world.vehicle.get_transform()
|
||||
v = world.vehicle.get_velocity()
|
||||
c = world.vehicle.get_vehicle_control()
|
||||
c = world.vehicle.get_control()
|
||||
heading = 'N' if abs(t.rotation.yaw) < 89.5 else ''
|
||||
heading += 'S' if abs(t.rotation.yaw) > 90.5 else ''
|
||||
heading += 'E' if 179.5 > t.rotation.yaw > 0.5 else ''
|
||||
|
|
|
@ -246,7 +246,7 @@ class KeyboardControl(object):
|
|||
self._control.gear = 1 if self._control.reverse else -1
|
||||
elif event.key == K_m:
|
||||
self._control.manual_gear_shift = not self._control.manual_gear_shift
|
||||
self._control.gear = world.vehicle.get_vehicle_control().gear
|
||||
self._control.gear = world.vehicle.get_control().gear
|
||||
world.hud.notification('%s Transmission' % ('Manual' if self._control.manual_gear_shift else 'Automatic'))
|
||||
elif self._control.manual_gear_shift and event.key == K_COMMA:
|
||||
self._control.gear = max(-1, self._control.gear - 1)
|
||||
|
@ -314,7 +314,7 @@ class HUD(object):
|
|||
return
|
||||
t = world.vehicle.get_transform()
|
||||
v = world.vehicle.get_velocity()
|
||||
c = world.vehicle.get_vehicle_control()
|
||||
c = world.vehicle.get_control()
|
||||
heading = 'N' if abs(t.rotation.yaw) < 89.5 else ''
|
||||
heading += 'S' if abs(t.rotation.yaw) > 90.5 else ''
|
||||
heading += 'E' if 179.5 > t.rotation.yaw > 0.5 else ''
|
||||
|
|
|
@ -69,7 +69,7 @@ void export_actor() {
|
|||
class_<cc::Vehicle, bases<cc::Actor>, boost::noncopyable, boost::shared_ptr<cc::Vehicle>>("Vehicle", no_init)
|
||||
.add_property("bounding_box", CALL_RETURNING_COPY(cc::Vehicle, GetBoundingBox))
|
||||
.def("apply_control", &cc::Vehicle::ApplyControl, (arg("control")))
|
||||
.def("get_vehicle_control", &cc::Vehicle::GetVehicleControl)
|
||||
.def("get_control", &cc::Vehicle::GetControl)
|
||||
.def("set_autopilot", &cc::Vehicle::SetAutopilot, (arg("enabled")=true))
|
||||
.def(self_ns::str(self_ns::self))
|
||||
;
|
||||
|
|
Loading…
Reference in New Issue