Walkers check vehicles in the direction to go

This commit is contained in:
bernatx 2019-12-02 14:54:56 +01:00 committed by bernat
parent a41815f54c
commit ad0488006a
6 changed files with 18 additions and 21 deletions

View File

@ -151,14 +151,16 @@ namespace detail {
if (agent) {
// draw for debug
carla::geom::Location p1(agent->npos[0], agent->npos[2], agent->npos[1] + 1);
std::ostringstream out;
out << *reinterpret_cast<const float *>(&agent->params.userData);
carla::rpc::DebugShape text;
text.life_time = 0.01f;
text.persistent_lines = false;
text.primitive = carla::rpc::DebugShape::String {p1, out.str(), false};
text.color = { 0, 255, 0 };
_client.DrawDebugShape(text);
if (agent->params.userData) {
std::ostringstream out;
out << *(reinterpret_cast<const float *>(agent->params.userData));
carla::rpc::DebugShape text;
text.life_time = 0.01f;
text.persistent_lines = false;
text.primitive = carla::rpc::DebugShape::String {p1, out.str(), false};
text.color = { 0, 255, 0 };
_client.DrawDebugShape(text);
}
}
}
}

View File

@ -477,7 +477,7 @@ namespace nav {
params.collisionQueryRange = 10;
params.obstacleAvoidanceType = 3;
params.separationWeight = 0.5f;
// set if the agent can cross roads or not
if (frand() <= _probability_crossing) {
params.queryFilterType = 1;

View File

@ -33,12 +33,7 @@ namespace nav {
// check if the agent has any vehicle around
if (_manager && !(_manager->GetNavigation()->HasVehicleNear(_id, 6.0f)))
return EventResult::End;
else
{
// make look at the next point to go
carla::geom::Location location;
if (_manager->GetWalkerNextPoint(_id, location))
_manager->GetNavigation()->SetWalkerLookAt(_id, location);
} else {
return EventResult::Continue;
}
}

View File

@ -15,12 +15,12 @@ set(CARLA_LOCATION $ENV{CARLA_LOCATION})
include_directories(source/pipeline/)
include_directories(${LIBCARLA_LOCATION}/source/)
include_directories(${CARLA_LOCATION}/Build/boost-1.69.0-c7-install/include)
include_directories(${CARLA_LOCATION}/Build/recast-aca316-c7-install/include)
include_directories(${CARLA_LOCATION}/Build/recast-32ee67-c7-install/include)
include_directories(${CARLA_LOCATION}/Build/rpclib-v2.2.1_c2-c7-libstdcxx-install/include)
link_directories(${LIBCARLA_LOCATION}/lib/)
link_directories(${CARLA_LOCATION}/Build/boost-1.69.0-c7-install/lib)
link_directories(${CARLA_LOCATION}/Build/recast-aca316-c7-install/lib)
link_directories(${CARLA_LOCATION}/Build/recast-32ee67-c7-install/lib)
link_directories(${CARLA_LOCATION}/Build/rpclib-v2.2.1_c2-c7-libstdcxx-install/lib)
link_directories(${CARLA_LOCATION}/PythonAPI/carla/dependencies/lib)

4
Util/BuildTools/Setup.sh Executable file → Normal file
View File

@ -289,8 +289,8 @@ unset GTEST_BASENAME
# -- Get Recast&Detour and compile it with libc++ ------------------------------
# ==============================================================================
RECAST_HASH=aca316
RECAST_COMMIT=aca31602cd38f881e278bfe4179405265e785a68
RECAST_HASH=32ee67
RECAST_COMMIT=32ee6788793651f815413bf8bed326a15110dff9
RECAST_BASENAME=recast-${RECAST_HASH}-${CXX_TAG}
RECAST_INCLUDE=${PWD}/${RECAST_BASENAME}-install/include

View File

@ -32,8 +32,8 @@ if not "%1"=="" (
goto :arg-parse
)
set RECAST_HASH=aca316
set RECAST_COMMIT=aca31602cd38f881e278bfe4179405265e785a68
set RECAST_HASH=32ee67
set RECAST_COMMIT=32ee6788793651f815413bf8bed326a15110dff9
set RECAST_SRC=recast-%RECAST_HASH%-src
set RECAST_SRC_DIR=%BUILD_DIR%%RECAST_SRC%\
set RECAST_INSTALL=recast-%RECAST_HASH%-install