chore(les1): Clean up template
This commit is contained in:
@@ -1,116 +1,53 @@
|
||||
// #include "rclcpp/rclcpp.hpp"
|
||||
// Wessel T <contact@wessel.gg> (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<LesNode>();
|
||||
// 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: <x>
|
||||
* Changelog:
|
||||
* [04-09-2025] Wessel T:
|
||||
* - Implement template
|
||||
*/
|
||||
|
||||
|
||||
//-- tester: Sander Gieling
|
||||
|
||||
|
||||
|
||||
//--general includes
|
||||
#include <cstdlib>
|
||||
#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<Template_General>();
|
||||
|
||||
auto node = std::make_shared<Template_General>();
|
||||
|
||||
|
||||
rclcpp::spin(node);
|
||||
|
||||
rclcpp::shutdown();
|
||||
|
||||
return 0;
|
||||
rclcpp::spin(node);
|
||||
rclcpp::shutdown();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user