Skip to content

Commit 89ce03e

Browse files
committed
fix build errors
1 parent 4e23fa3 commit 89ce03e

File tree

9 files changed

+724
-593
lines changed

9 files changed

+724
-593
lines changed

apps/mrpt_apps_gui/holonomic-navigator-demo/holonomic_navigator_demoMain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ void holonomic_navigator_demoFrame::simulateOneStep(double time_step)
703703
ni.maxRobotSpeed = m_simul_options.ROBOT_MAX_SPEED;
704704
ni.maxObstacleDist = m_simul_options.MAX_SENSOR_RADIUS;
705705

706-
this->m_holonomicMethod->navigate(ni, no);
706+
no = this->m_holonomicMethod->navigate(ni);
707707

708708
mrpt::nav::CHolonomicLogFileRecord::Ptr out_log = no.logRecord;
709709

apps/mrpt_apps_gui/ptg-configurator/ptgConfiguratorMain.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,9 +1095,10 @@ void ptgConfiguratorframe::rebuild3Dview()
10951095
{
10961096
if (ptg && ptg->isInitialized())
10971097
{
1098-
int k = 0;
1099-
double norm_d = 0;
1100-
bool is_exact = ptg->inverseMap_WS2TP(tx, ty, k, norm_d);
1098+
const auto inv = ptg->inverseMap_WS2TP(tx, ty);
1099+
const bool is_exact = inv.has_value();
1100+
const int k = is_exact ? inv->first : 0;
1101+
const double norm_d = is_exact ? inv->second : 0.0;
11011102
const double dir = ptg->index2alpha(k);
11021103
if (is_exact)
11031104
{

doc/source/doxygen-docs/port_mrpt3.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -371,22 +371,10 @@ abstraction. Each should be broken into named helpers:
371371
372372
| Function | Lines | Suggested split |
373373
|----------|-------|-----------------|
374-
| `PlannerSimple2D::computePath()` | ~465 | Extract `wavePropagation()`, `backtrackPath()` |
375-
| `PlannerRRT_SE2_TPS::solve()` | ~380 | Extract `sampleFreeSpace()`, `extendTree()`, `optimizePath()` |
376-
| `CHolonomicFullEval::evalSingleTarget()` | ~290 | Extract `scoreCandidateDirection()`, `applyPenalties()` |
377-
| `CHolonomicFullEval::navigate()` | ~170 | Extract `findGaps()`, `selectBestDirection()` |
378-
| `CHolonomicND::gapsEstimator()` | ~150 | Extract gap-merging and gap-filtering helpers |
379-
| `CLogFileRecord::serializeFrom()` | ~450 | Version-switch per struct field group |
374+
| `CLogFileRecord::serializeFrom()` | ~450 | Version-switch per struct field group (high backward-compat risk, deferred) |
380375
381376
---
382377
383-
#### 13.6.10 Test coverage (remaining)
384-
385-
Zero dedicated unit tests for:
386-
387-
- `CWaypointsNavigator` state machine (requires full robot interface mock).
388-
- `CNavigatorManualSequence`.
389-
390378
---
391379
392380
### 13.7 `mrpt_maps` — Miscellaneous

modules/mrpt_nav/include/mrpt/nav/holonomic/CHolonomicFullEval.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,21 @@ class CHolonomicFullEval : public CAbstractHolonomicReactiveMethod
131131
/** Evals one single target of the potentially many of them in NavInput */
132132
void evalSingleTarget(unsigned int target_idx, const NavInput& ni, EvalOutput& eo);
133133

134+
/** Fills m_dirs_scores with the 8 raw factor values for every direction. */
135+
void fillFactorScores(
136+
size_t nDirs,
137+
const NavInput& ni,
138+
const mrpt::math::TPose2D& target,
139+
unsigned int target_k,
140+
double target_dist,
141+
const std::vector<mrpt::math::TPoint2D>& obstacles_2d,
142+
const mrpt::obs::CSinCosLookUpTableFor2DScans::TSinCosValues& sc_lut,
143+
CParameterizedTrajectoryGenerator* ptg);
144+
145+
/** Runs multi-phase scoring on m_dirs_scores and fills eo.phase_scores. */
146+
void computePhaseScores(
147+
size_t nDirs, const NavInput& ni, unsigned int target_idx, EvalOutput& eo);
148+
134149
mrpt::obs::CSinCosLookUpTableFor2DScans m_sincos_lut;
135150
}; // end of CHolonomicFullEval
136151

modules/mrpt_nav/include/mrpt/nav/planners/PlannerRRT_SE2_TPS.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,27 @@ class PlannerRRT_SE2_TPS : public PlannerTPS_VirtualBase
109109
protected:
110110
bool m_initialized{false};
111111

112+
private:
113+
using CandidateMap = std::map<double, TMoveEdgeSE2_TP>;
114+
115+
/** Insert the lowest-cost candidate edge into the tree and update the best
116+
* solution tracking in `result`. Returns true if this edge is a new
117+
* best solution to the goal. */
118+
bool tryInsertBestCandidate(
119+
const CandidateMap& candidates, const TPlannerInput& pi, TPlannerResult& result);
120+
121+
/** Save a 3-D scene log of the current tree state (respects
122+
* params.save_3d_log_freq decimation). */
123+
void saveSolveIterationLog(
124+
const TPlannerInput& pi,
125+
const TPlannerResult& result,
126+
const mrpt::poses::CPose2D& x_rand_pose,
127+
const std::string& log_msg,
128+
size_t& log_decimation_cnt,
129+
size_t rrt_iter_counter,
130+
size_t solve_count,
131+
bool highlight_last_edge = true);
132+
112133
}; // end class PlannerRRT_SE2_TPS
113134

114135
/** @} */

0 commit comments

Comments
 (0)