Merge branch 'dev'

This commit is contained in:
nsubiron 2017-06-20 09:49:56 +01:00
commit f22656131e
17 changed files with 76 additions and 65 deletions

View File

@ -1,3 +1,9 @@
## CARLA 0.4.4
* Fixed regression walkers despawning when stopping after seeing a car
* Changed, collision is only registered if player moves faster than 1 km/h
* Fixed issue walkers resume movement after sensing nothing, but the car is still there sometimes
## CARLA 0.4.3 ## CARLA 0.4.3
* Fixed issue with reward, intersect other lane wasn't sent to the client * Fixed issue with reward, intersect other lane wasn't sent to the client

View File

@ -1,7 +1,7 @@
{ {
"FileVersion": 3, "FileVersion": 3,
"Version": 1, "Version": 1,
"VersionName": "0.4.3", "VersionName": "0.4.4",
"FriendlyName": "CARLA", "FriendlyName": "CARLA",
"Description": "", "Description": "",
"Category": "Science", "Category": "Science",

View File

@ -1,6 +1,10 @@
CARLA UE4 CARLA UE4
========= =========
To run the game with the second city
$ CarlaUE4.sh /Game/Maps/CARLA_ORIGIN_1
To run the game at fixed time-step, e.g. 30 FPS To run the game at fixed time-step, e.g. 30 FPS
$ CarlaUE4.sh -benchmark -fps=30 $ CarlaUE4.sh -benchmark -fps=30

View File

@ -204,10 +204,10 @@ void AWalkerAIController::OnMoveCompleted(
void AWalkerAIController::SenseActors(const TArray<AActor *> Actors) void AWalkerAIController::SenseActors(const TArray<AActor *> Actors)
{ {
const auto *aPawn = GetPawn(); const auto *aPawn = GetPawn();
if ((aPawn != nullptr) && IntersectsWithVehicle(*aPawn, Actors)) { if ((Status == EWalkerStatus::Moving) &&
(aPawn != nullptr) &&
IntersectsWithVehicle(*aPawn, Actors)) {
TryPauseMovement(); TryPauseMovement();
} else if (Status == EWalkerStatus::Paused) {
TryResumeMovement();
} }
} }

View File

@ -116,7 +116,9 @@ void AWalkerSpawnerBase::Tick(float DeltaTime)
const int32 Index = (++CurrentIndexToCheck % WalkersBlackList.Num()); const int32 Index = (++CurrentIndexToCheck % WalkersBlackList.Num());
auto Walker = WalkersBlackList[Index]; auto Walker = WalkersBlackList[Index];
const auto Status = GetWalkerStatus(Walker); const auto Status = GetWalkerStatus(Walker);
if (Status != EWalkerStatus::Moving) { if ((Status == EWalkerStatus::MoveCompleted) ||
(Status == EWalkerStatus::Invalid) ||
(Status == EWalkerStatus::RunOver)) {
WalkersBlackList.RemoveAtSwap(Index); WalkersBlackList.RemoveAtSwap(Index);
if ((Walker != nullptr) && (Status != EWalkerStatus::RunOver)) { if ((Walker != nullptr) && (Status != EWalkerStatus::RunOver)) {
Walker->Destroy(); Walker->Destroy();

View File

@ -6,7 +6,7 @@
#include "ModuleManager.h" #include "ModuleManager.h"
#include "NonCopyable.h" #include "Util/NonCopyable.h"
DECLARE_LOG_CATEGORY_EXTERN(LogCarla, Log, All); DECLARE_LOG_CATEGORY_EXTERN(LogCarla, Log, All);
DECLARE_LOG_CATEGORY_EXTERN(LogCarlaServer, Log, All); DECLARE_LOG_CATEGORY_EXTERN(LogCarlaServer, Log, All);

View File

@ -3,7 +3,7 @@
#include "Carla.h" #include "Carla.h"
#include "DynamicWeather.h" #include "DynamicWeather.h"
#include "IniFile.h" #include "Util/IniFile.h"
#include "Components/ArrowComponent.h" #include "Components/ArrowComponent.h"

View File

@ -5,7 +5,7 @@
#include "CommandLine.h" #include "CommandLine.h"
#include "DynamicWeather.h" #include "DynamicWeather.h"
#include "IniFile.h" #include "Util/IniFile.h"
// INI file sections. // INI file sections.
#define S_CARLA_SERVER TEXT("CARLA/Server") #define S_CARLA_SERVER TEXT("CARLA/Server")

View File

@ -245,7 +245,10 @@ void ACarlaVehicleController::OnCollisionEvent(
FVector NormalImpulse, FVector NormalImpulse,
const FHitResult& Hit) const FHitResult& Hit)
{ {
CarlaPlayerState->RegisterCollision(Actor, OtherActor, NormalImpulse, Hit); // Register collision only if we are moving faster than 1 km/h.
if (FMath::Abs(GetVehicleForwardSpeed()) > 1.0f) {
CarlaPlayerState->RegisterCollision(Actor, OtherActor, NormalImpulse, Hit);
}
} }
// ============================================================================= // =============================================================================

View File

@ -3,8 +3,8 @@
#pragma once #pragma once
#include "GraphTypes.h" #include "GraphTypes.h"
#include "ListView.h"
#include "Position.h" #include "Position.h"
#include "Util/ListView.h"
#include <array> #include <array>
#include <list> #include <list>

View File

@ -1,43 +0,0 @@
// CARLA, Copyright (C) 2017 Computer Vision Center (CVC)
#pragma once
namespace MapGen {
template<typename IT>
class CARLA_API ListView
{
public:
using iterator = IT;
explicit ListView(iterator begin, iterator end) : Begin(begin), End(end) {}
template <typename STL_CONTAINER>
explicit ListView(STL_CONTAINER &StlContainer) :
Begin(iterator(StlContainer.begin())),
End(iterator(StlContainer.end())) {}
ListView(const ListView &) = default;
ListView &operator=(const ListView &) = delete;
iterator begin() const {
return Begin;
}
iterator end() const {
return End;
}
bool empty() const {
return Begin == End;
}
private:
const iterator Begin;
const iterator End;
};
} // namespace MapGen

View File

@ -14,9 +14,9 @@
#define LOCTEXT_NAMESPACE "CarlaRoadMap" #define LOCTEXT_NAMESPACE "CarlaRoadMap"
/// ============================================================================ // =============================================================================
/// -- Static local methods ---------------------------------------------------- // -- Static local methods -----------------------------------------------------
/// ============================================================================ // =============================================================================
static uint32 ClampFloatToUInt(const float Value, int32 Min, int32 Max) static uint32 ClampFloatToUInt(const float Value, int32 Min, int32 Max)
{ {
@ -31,9 +31,9 @@ static float GetRotatedAzimuthAngle(const FVector &Direction)
return SphericalCoords.Y + PI; return SphericalCoords.Y + PI;
} }
/// ============================================================================ // =============================================================================
/// -- FRoadMapPixelData ------------------------------------------------------- // -- FRoadMapPixelData --------------------------------------------------------
/// ============================================================================ // =============================================================================
uint16 FRoadMapPixelData::Encode(bool IsRoad, bool HasDirection, const FVector &Direction) uint16 FRoadMapPixelData::Encode(bool IsRoad, bool HasDirection, const FVector &Direction)
{ {
@ -58,9 +58,9 @@ FColor FRoadMapPixelData::EncodeAsColor() const
} }
} }
/// ============================================================================ // =============================================================================
/// -- URoadMap ---------------------------------------------------------------- // -- URoadMap -----------------------------------------------------------------
/// ============================================================================ // =============================================================================
URoadMap::URoadMap(const FObjectInitializer& ObjectInitializer) : URoadMap::URoadMap(const FObjectInitializer& ObjectInitializer) :
Super(ObjectInitializer), Super(ObjectInitializer),

View File

@ -3,7 +3,7 @@
#pragma once #pragma once
#include "GraphTypes.h" #include "GraphTypes.h"
#include "NonCopyable.h" #include "Util/NonCopyable.h"
#include <vector> #include <vector>

View File

@ -0,0 +1,39 @@
// CARLA, Copyright (C) 2017 Computer Vision Center (CVC)
#pragma once
template<typename IT>
class CARLA_API ListView
{
public:
using iterator = IT;
explicit ListView(iterator begin, iterator end) : Begin(begin), End(end) {}
template <typename STL_CONTAINER>
explicit ListView(STL_CONTAINER &StlContainer) :
Begin(iterator(StlContainer.begin())),
End(iterator(StlContainer.end())) {}
ListView(const ListView &) = default;
ListView &operator=(const ListView &) = delete;
iterator begin() const {
return Begin;
}
iterator end() const {
return End;
}
bool empty() const {
return Begin == End;
}
private:
const iterator Begin;
const iterator End;
};

View File

@ -7,5 +7,5 @@ public:
NonCopyable(const NonCopyable &) = delete; NonCopyable(const NonCopyable &) = delete;
void operator=(const NonCopyable &x) = delete; void operator=(const NonCopyable &) = delete;
}; };

View File

@ -3,7 +3,7 @@
#include "Carla.h" #include "Carla.h"
#include "WeatherDescription.h" #include "WeatherDescription.h"
#include "IniFile.h" #include "Util/IniFile.h"
static FString PrecipitationTypeToString(EPrecipitationType PrecipitationType) static FString PrecipitationTypeToString(EPrecipitationType PrecipitationType)
{ {