Preserve installed operator workspace before consolidation

Local preservation snapshot, not a new deployment or simulation acceptance.
This commit is contained in:
DCCONSTRUCTIONS
2026-10-08 09:59:51 +03:00
parent 97614742bb
commit d0e5f90952
368 changed files with 129172 additions and 1856 deletions
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.8)
project(ndc_rover_critics)
find_package(ament_cmake REQUIRED)
find_package(dwb_core REQUIRED)
find_package(dwb_msgs REQUIRED)
find_package(nav2_util REQUIRED)
find_package(rclcpp REQUIRED)
find_package(pluginlib REQUIRED)
add_library(ndc_rover_critics SHARED forward_tracks.cpp)
target_compile_features(ndc_rover_critics PUBLIC cxx_std_17)
ament_target_dependencies(ndc_rover_critics dwb_core dwb_msgs nav2_util rclcpp pluginlib)
pluginlib_export_plugin_description_file(dwb_core critics.xml)
install(TARGETS ndc_rover_critics LIBRARY DESTINATION lib)
ament_package()
@@ -0,0 +1,5 @@
<library path="ndc_rover_critics">
<class type="ndc_rover_critics::ForwardTracksCritic" base_class_type="dwb_core::TrajectoryCritic">
<description>Reject forward arcs requiring a track to reverse; native in-place spin remains separate.</description>
</class>
</library>
@@ -0,0 +1,40 @@
// DWB owns velocity sampling/scoring. This admits the rover's existing forward
// mode before scoring; it does not rewrite a velocity or propose another path.
#include <cmath>
#include <stdexcept>
#include <vector>
#include "dwb_core/trajectory_critic.hpp"
#include "dwb_core/exceptions.hpp"
#include "nav2_util/node_utils.hpp"
#include "pluginlib/class_list_macros.hpp"
namespace ndc_rover_critics {
class ForwardTracksCritic : public dwb_core::TrajectoryCritic {
std::vector<double> centres_;
public:
void onInit() override {
auto node = node_.lock();
if (!node) {throw std::runtime_error("No DWB lifecycle node");}
const auto key = dwb_plugin_name_ + "." + name_ + ".track_centres_y_m";
nav2_util::declare_parameter_if_not_declared(
node, key, rclcpp::ParameterValue(std::vector<double>{}));
node->get_parameter(key, centres_);
if (centres_.size() != 2 || !std::isfinite(centres_[0]) ||
!std::isfinite(centres_[1]) || centres_[0] <= centres_[1]) {
throw std::runtime_error("Ordered measured left/right track centres required");
}
}
double scoreTrajectory(const dwb_msgs::msg::Trajectory2D & traj) override {
const double v = traj.velocity.x, w = traj.velocity.theta;
// Match SupportPolicy.fresh_context's existing 1e-6 direction boundary:
// a stationary inner track needs both front/rear observations, just as a
// spin does. Forward mode keeps both tracks moving forward; it cannot
// silently request that different observation contract at the boundary.
if (v > 1e-8 && (v - w*centres_[0] < 1e-6 || v - w*centres_[1] < 1e-6)) {
throw dwb_core::IllegalTrajectoryException(name_, "Forward arc stops or reverses a track");
}
return 0.0;
}
};
}
PLUGINLIB_EXPORT_CLASS(ndc_rover_critics::ForwardTracksCritic, dwb_core::TrajectoryCritic)
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<package format="3">
<name>ndc_rover_critics</name><version>0.1.0</version>
<description>Selected track kinematics admission for upstream DWB candidates.</description>
<maintainer email="engineering@nodedc.local">Mission Core</maintainer>
<license>BSD-3-Clause</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>dwb_core</depend><depend>dwb_msgs</depend><depend>nav2_util</depend>
<depend>rclcpp</depend><depend>pluginlib</depend>
<export><build_type>ament_cmake</build_type></export>
</package>