- Manual Control example fix for asynchronous captures.
- Server Game Controller flushes render queue before sending measurements.
This commit is contained in:
parent
a2a6105c0e
commit
f637b0a6d1
|
@ -188,11 +188,11 @@ class CarlaGame(object):
|
||||||
|
|
||||||
measurements, sensor_data = self.client.read_data()
|
measurements, sensor_data = self.client.read_data()
|
||||||
|
|
||||||
self._main_image = sensor_data['CameraRGB']
|
self._main_image = sensor_data.get('CameraRGB',None)
|
||||||
self._mini_view_image1 = sensor_data['CameraDepth']
|
self._mini_view_image1 = sensor_data.get('CameraDepth' ,None)
|
||||||
self._mini_view_image2 = sensor_data['CameraSemSeg']
|
self._mini_view_image2 = sensor_data.get('CameraSemSeg',None)
|
||||||
if self._enable_lidar:
|
if self._enable_lidar:
|
||||||
self._lidar_measurement = sensor_data['Lidar32']
|
self._lidar_measurement = sensor_data.get('Lidar32',None)
|
||||||
|
|
||||||
# Print measurements every second.
|
# Print measurements every second.
|
||||||
if self._timer.elapsed_seconds_since_lap() > 1.0:
|
if self._timer.elapsed_seconds_since_lap() > 1.0:
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "Server/CarlaServer.h"
|
#include "Server/CarlaServer.h"
|
||||||
#include "Server/ServerSensorDataSink.h"
|
#include "Server/ServerSensorDataSink.h"
|
||||||
#include "Settings/CarlaSettings.h"
|
#include "Settings/CarlaSettings.h"
|
||||||
|
#include "Private/RenderTargetTemp.h"
|
||||||
|
|
||||||
using Errc = FCarlaServer::ErrorCode;
|
using Errc = FCarlaServer::ErrorCode;
|
||||||
|
|
||||||
|
@ -120,10 +121,16 @@ void FServerGameController::Tick(float DeltaSeconds)
|
||||||
|
|
||||||
// Send measurements.
|
// Send measurements.
|
||||||
{
|
{
|
||||||
|
if(CarlaSettings->bSynchronousMode)
|
||||||
|
{
|
||||||
|
FlushRenderingCommands();
|
||||||
|
}
|
||||||
|
|
||||||
if (Errc::Error == Server->SendMeasurements(
|
if (Errc::Error == Server->SendMeasurements(
|
||||||
DataRouter.GetPlayerState(),
|
DataRouter.GetPlayerState(),
|
||||||
DataRouter.GetAgents(),
|
DataRouter.GetAgents(),
|
||||||
CarlaSettings->bSendNonPlayerAgentsInfo)) {
|
CarlaSettings->bSendNonPlayerAgentsInfo))
|
||||||
|
{
|
||||||
Server = nullptr;
|
Server = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue