From ab38941976ca402608831573a91861d929380bc3 Mon Sep 17 00:00:00 2001 From: danielbrownmsm Date: Thu, 15 Feb 2024 22:16:58 -0600 Subject: [PATCH] code builds now or, at least, kind of --- .../src/autonav_nav/include/autonav_nav/astar.h | 11 ++++++----- autonav_ws/src/autonav_nav/src/astar.cpp | 12 +++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/autonav_ws/src/autonav_nav/include/autonav_nav/astar.h b/autonav_ws/src/autonav_nav/include/autonav_nav/astar.h index 21b3e5ee..64910fca 100644 --- a/autonav_ws/src/autonav_nav/include/autonav_nav/astar.h +++ b/autonav_ws/src/autonav_nav/include/autonav_nav/astar.h @@ -41,16 +41,17 @@ struct GraphNode { class AStarNode : public SCR::Node { public: - AStarNode(); + AStarNode() : SCR::Node("astar_fast") {} + ~AStarNode() {}; void init() override; private: // === ros things === // subcribers - rclcpp::Subscription leftExpandedSubscriber; - rclcpp::Subscription rightExpandedSubscriber; - rclcpp::Subscription poseSubscriber; - rclcpp::Subscription imuSubscriber; + rclcpp::Subscription::SharedPtr leftExpandedSubscriber; + rclcpp::Subscription::SharedPtr rightExpandedSubscriber; + rclcpp::Subscription::SharedPtr poseSubscriber; + rclcpp::Subscription::SharedPtr imuSubscriber; // publishers rclcpp::Publisher::SharedPtr pathPublisher; diff --git a/autonav_ws/src/autonav_nav/src/astar.cpp b/autonav_ws/src/autonav_nav/src/astar.cpp index fbb40b1e..71338afd 100644 --- a/autonav_ws/src/autonav_nav/src/astar.cpp +++ b/autonav_ws/src/autonav_nav/src/astar.cpp @@ -9,10 +9,8 @@ // also TODO make the file reading code so we can a list of waypoints and stuff //TODO make smellification or whatever goal-finding heuristic algorithm thingy //TODO use reserve() to not have to constantly resize all our vectors +//TODO write actual subscriber methods and whatnot -AstarNode AStarNode::AstarNode() : SCR::Node("astar_fast") { - //TODO constructor or something -} void AStarNode::init() { // TODO do this? @@ -26,12 +24,12 @@ void AStarNode::init() { // left/right filtered subscribers - leftExpandedSubscriber = this->create_subscription("/autonav/cfg_space/expanded/left", std::bind(&AStarNode::onLeftReceived, this, std::placeholders::_1), 20); - rightExpandedSubscriber = this->create_subscription("/autonav/cfg_space/expanded/right", std::bind(&AStarNode::onRightReceived, this, std::placeholders::_1), 20); + leftExpandedSubscriber = this->create_subscription("/autonav/cfg_space/expanded/left", 20, std::bind(&AStarNode::onLeftReceived, this, std::placeholders::_1)); + rightExpandedSubscriber = this->create_subscription("/autonav/cfg_space/expanded/right", 20, std::bind(&AStarNode::onRightReceived, this, std::placeholders::_1)); // localization data subscribers - poseSubscriber = this->create_subscription("/autonav/position", std::bind(&AStarNode::onPoseReceived, this, std::placeholders::_1), 20); - imuSubscriber = this->create_subscription("/autonav/imu", std::bind(&AStarNode::onImuReceived, this, std::placeholders::_1), 20); + poseSubscriber = this->create_subscription("/autonav/position", 20, std::bind(&AStarNode::onPoseReceived, this, std::placeholders::_1)); + imuSubscriber = this->create_subscription("/autonav/imu", 20, std::bind(&AStarNode::onImuReceived, this, std::placeholders::_1)); // raw_map_subscriber = create_subscription(directionify("/autonav/cfg_space/raw"), 20, std::bind(&ExpandifyNode::onConfigSpaceReceived, this, std::placeholders::_1)); // === publishers ===