Permalink
Browse files

fix DLL-exposed static vars

  • Loading branch information...
jlblancoc committed Jul 16, 2018
1 parent 20e5e10 commit 7d7a6b3e4c4e3452331cbe2deeb457bf15ec6c87
@@ -323,7 +323,7 @@ class CParameterizedTrajectoryGenerator

/** The path used as defaul output in, for example, debugDumpInFiles.
* (Default="./reactivenav.logs/") */
static std::string OUTPUT_DEBUG_PATH_PREFIX;
static std::string &OUTPUT_DEBUG_PATH_PREFIX();

/** Must be called after setting all PTG parameters and before requesting
* converting obstacles to TP-Space, inverseMap_WS2TP(), etc. */
@@ -426,7 +426,7 @@ class CParameterizedTrajectoryGenerator
* right at the beginning of a PTG trajectory.
* Default value: COLL_BEH_BACK_AWAY
*/
static PTG_collision_behavior_t COLLISION_BEHAVIOR;
static PTG_collision_behavior_t &COLLISION_BEHAVIOR();

/** Must be called to resize a CD to its correct size, before calling
* updateClearance() */
@@ -17,11 +17,21 @@

using namespace mrpt::nav;

std::string CParameterizedTrajectoryGenerator::OUTPUT_DEBUG_PATH_PREFIX =
"./reactivenav.logs";
PTG_collision_behavior_t CParameterizedTrajectoryGenerator::COLLISION_BEHAVIOR =
static std::string OUTPUT_DEBUG_PATH_PREFIX = "./reactivenav.logs";
static PTG_collision_behavior_t COLLISION_BEHAVIOR =
mrpt::nav::COLL_BEH_BACK_AWAY;

std::string& CParameterizedTrajectoryGenerator::OUTPUT_DEBUG_PATH_PREFIX()
{
return ::OUTPUT_DEBUG_PATH_PREFIX;
}

PTG_collision_behavior_t&
CParameterizedTrajectoryGenerator::COLLISION_BEHAVIOR()
{
return ::COLLISION_BEHAVIOR;
}

IMPLEMENTS_VIRTUAL_SERIALIZABLE(
CParameterizedTrajectoryGenerator, CSerializable, mrpt::nav)

@@ -70,7 +80,9 @@ void CParameterizedTrajectoryGenerator::loadFromConfigFile(
sSection);

// Ensure a minimum of resolution:
mrpt::keep_max(m_clearance_num_points, refDistance / 1.0);
mrpt::keep_max(
m_clearance_num_points,
static_cast<decltype(m_clearance_num_points)>(refDistance / 1.0));

// Optional params, for debugging only
MRPT_LOAD_HERE_CONFIG_VAR(
@@ -276,7 +288,7 @@ bool CParameterizedTrajectoryGenerator::debugDumpInFiles(
using namespace std;

const char* sPath =
CParameterizedTrajectoryGenerator::OUTPUT_DEBUG_PATH_PREFIX.c_str();
CParameterizedTrajectoryGenerator::OUTPUT_DEBUG_PATH_PREFIX().c_str();

mrpt::system::createDirectory(sPath);
mrpt::system::createDirectory(mrpt::format("%s/PTGs", sPath));
@@ -426,7 +438,7 @@ void CParameterizedTrajectoryGenerator::internal_TPObsDistancePostprocess(

// Handle the special case of obstacles *inside* the robot at the begining
// of the PTG path:
switch (COLLISION_BEHAVIOR)
switch (COLLISION_BEHAVIOR())
{
case COLL_BEH_STOP:
inout_tp_obs = .0;

0 comments on commit 7d7a6b3

Please sign in to comment.