Skip to content

Commit

Permalink
fixed an issue with reversing
Browse files Browse the repository at this point in the history
  • Loading branch information
karlkurzer committed May 20, 2016
1 parent b9e8816 commit 5886e9b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ set(HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/include/gradient.h
${CMAKE_CURRENT_SOURCE_DIR}/include/dubins.h
)
add_library(HYAS ${SOURCES} ${HEADERS})
#add_library(HYAS ${SOURCES} ${HEADERS})

## Declare a catkin package
catkin_package()
Expand All @@ -69,4 +69,4 @@ target_link_libraries(tf_broadcaster ${catkin_LIBRARIES})
add_executable(hybrid_astar src/main.cpp ${SOURCES} ${HEADERS})
target_link_libraries(hybrid_astar ${catkin_LIBRARIES})
target_link_libraries(hybrid_astar ${OMPL_LIBRARIES})
target_link_libraries(hybrid_astar ${HYAS})
#target_link_libraries(hybrid_astar ${HYAS})
5 changes: 1 addition & 4 deletions include/collisiondetection.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ namespace HybridAStar {
class CollisionDetection {
public:
/// Constructor
CollisionDetection() {
this->grid = nullptr;
Lookup::collisionLookup(collisionLookup);
}
CollisionDetection();

/*!
\brief evaluates whether the configuration is safe
Expand Down
6 changes: 3 additions & 3 deletions include/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ static const bool visualization = 0 * manual;
static const bool visualization2D = 0 * manual;

// flag -- to turn on reversin of the vehicle
static const bool reverse = false;
static const bool reverse = true;

// flag -- to turn on the dubins shot
static const bool dubinsShot = true;

// flag -- to turn on the dubins heuristic
static const bool dubins = true;
static const bool dubins = false;

// flag -- to turn on the dubins lookup
static const bool dubinsLookup = false * dubins;
Expand Down Expand Up @@ -95,7 +95,7 @@ static const float tieBreaker = 0.01;
static const float factor2D = sqrt(5) / sqrt(2) + 1;

// [#] -- penalty for turning
static const float penaltyTurning = 1.1;
static const float penaltyTurning = 1.05;

// [m] -- dubins shot step size
static const float dubinsStepSize = 1;
Expand Down
3 changes: 1 addition & 2 deletions src/algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ Node3D* Algorithm::hybridAStar(Node3D& start,
// _________
// GOAL TEST
if (*nPred == goal) {
//DEBUG
// std::cout << "max diff " << max << std::endl;
// DEBUG
return nPred;
}

Expand Down
4 changes: 4 additions & 0 deletions src/collisiondetection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@

using namespace HybridAStar;

CollisionDetection::CollisionDetection() {
this->grid = nullptr;
Lookup::collisionLookup(collisionLookup);
}
2 changes: 1 addition & 1 deletion src/node3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Node3D* Node3D::createSuccessor(const int i) {
else {
xSucc = x - dx[i - 3] * cos(t) - dy[i - 3] * sin(t);
ySucc = y - dx[i - 3] * sin(t) + dy[i - 3] * cos(t);
tSucc = helper::normalizeHeadingRad(t + dt[i - 3] + M_PI);
tSucc = helper::normalizeHeadingRad(t - dt[i - 3]);
}

return new Node3D(xSucc, ySucc, tSucc, g, 0, this, i);
Expand Down
2 changes: 1 addition & 1 deletion src/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void Planner::plan() {
// CLEAR THE VISUALIZATION
visualization.clear();
// FIND THE PATH
Node3D* nSolution = Algorithm::hybridAStar(nStart, nGoal, nodes3D, nodes2D, grid, collisionLookup, dubinsLookup, visualization,configurationSpace);
Node3D* nSolution = Algorithm::hybridAStar(nStart, nGoal, nodes3D, nodes2D, grid, collisionLookup, dubinsLookup, visualization, configurationSpace);
// CLEAR THE PATH
path.clear();
// TRACE THE PATH
Expand Down

0 comments on commit 5886e9b

Please sign in to comment.