From 85f2cda9b1f380de05dab74b6695deb80e3c4fa2 Mon Sep 17 00:00:00 2001 From: Wessel Tip Date: Thu, 4 Sep 2025 11:47:02 +0200 Subject: [PATCH] chore(les1): Clean up template --- src/les_pkg/src/les1.cpp | 137 +++++++++++---------------------------- 1 file changed, 37 insertions(+), 100 deletions(-) diff --git a/src/les_pkg/src/les1.cpp b/src/les_pkg/src/les1.cpp index af2f3d3..56076c6 100644 --- a/src/les_pkg/src/les1.cpp +++ b/src/les_pkg/src/les1.cpp @@ -1,116 +1,53 @@ -// #include "rclcpp/rclcpp.hpp" +// Wessel T (https://wessel.gg/) // -// namespace les_ws; -// -// class LesNode : public rclcpp::Node { -// public: -// LesNode() -// : Node("node_les1") -// { -// timer_ = this->create_wall_timer(std::chrono::seconds(1), std::bind) -// } -// -// private: -// int counter_ = 0; -// -// rclcpp::TimerBase::SharedPtr timer_; -// }; -// -// int main(int argc, char **argv) { -// rclcpp::init(argc, argv); -// auto node = std::make_shared(); -// rclcpp::spin(node); -// rclcpp::shutdown(); -// -// return 0; -// } -// -/* ---Node description: -...what the node is doing (functionally)... -When node is created the node prints "Hello you are new to ROS2" on terminal, -further it does nothing more than being alive -*/ +// "Build your own tower. +// A kingdom freed from malice. +// Create a world of bounty, peace and beauty." +// ⠀⣠⣶⣶⣤⣁ +// ⢰⣷⡟⠻⣏⠻⣧⣀⠐⠈⠀⡈⠠⠀⠂⠀⢁⠈⠀⠄⠀⠁⣠⣴⣤⡈ +// ⠀⣿⢿⡀⠘⢦⡈⢻⣦⠐⠀⠀⠄⠀⠁⠈⠀⡀⠠⠀⣠⡿⣿⣯⣽⡇ +// ⠀⢻⣿⠛⢦⣄⣹⠦⣌⣳⡀⠀⣠⠈⠀⢾⠀⠀⢀⣼⢯⠞⢡⣿⣿⠁ +// ⠄⠘⣿⣷⣤⡀⠙⣆⠈⠻⣿⡄⠘⣇⠀⣾⠀⣴⠿⢲⣋⣤⣿⡿⠃⠀ +// ⠀⡀⠹⣿⣦⡉⠛⠚⣆⠀⠈⠻⣆⢻⢠⣇⡾⠃⢠⣟⣠⣾⡞⠃⠀ +// ⠂⡀⠄⠹⣿⣏⠛⠒⠾⠷⣄⠀⠙⣞⣿⠋⣀⣴⣋⣽⡿⠋ +// ⠂⠠⠀⠀⣨⣿⢿⣶⣒⠲⢮⣿⣶⣼⣧⣾⣭⣿⠟⠉ +// ⠐⠀⠁⣰⣿⠓⠒⣛⣻⠟⠛⣩⣿⣯⠙⡯⣿⡆ +// ⠐⠀⠄⠸⣿⡟⢉⡽⢛⣿⡿⠉⠀⢸⣧⡷⣾⡇ +// ⠀⢂⠀⠄⠹⢿⣿⣴⣯⠏⠀⠀⠀⣼⢸⣽⣷⠇ +// ⠠⠀⠂⢀⠀⢀⠈⠉⠀⠀⠀⠂⡀⠹⠿⠛⠁⠀⠀ -/* ---Software changes: -one line per change -(1) created 31.3.2025: developer-Tilmann Koster reviewer(s)-Niek Ottens -(2) changed 01.4.2025: xxx functionality added ... : developer-Tilmann Koster reviewer(s)-Niek Ottens -... -*/ +/* les1.cpp + * Assignment done in the first lesson explaining + * the basics of ROS2 + * + * Reviewed by: + * Changelog: + * [04-09-2025] Wessel T: + * - Implement template + */ - -//-- tester: Sander Gieling - - - -//--general includes #include #include "rclcpp/rclcpp.hpp" -//--custom includes -//... - -//--using -//... - - -//--Node class - class Template_General : public rclcpp::Node { - public: - //-- constuctor: - Template_General() : Node("template_general_node") - { - //--communication and timer objects: - //see templates for subcribers, action server ... - //... - - //--customs functions: - custom_example(); - //... +public: + Template_General() + : Node("les1_node") + {} + void custom_example() { + RCLCPP_INFO(this->get_logger() ,"Hello you are new to ROS2"); } - - //-- communication and timer functions - //... - - //--customs functions: - void custom_example() - { - - /*your custom example code */ - RCLCPP_INFO(this->get_logger() ,"Hello you are new to ROS2"); //code example - /*your custom example code */ - - } - - //--custom variables: - - private: - - //--rclcpp variables: - // ... - - //--custom variables: - //... - }; +int main(int argc,char *argv[]) { + rclcpp::init(argc,argv); -int main(int argc,char *argv[]) -{ -rclcpp::init(argc,argv) ; + auto node = std::make_shared(); -auto node = std::make_shared(); - - -rclcpp::spin(node); - -rclcpp::shutdown(); - -return 0; + rclcpp::spin(node); + rclcpp::shutdown(); + return 0; }