From 422538dce4a8800cf42d09afe44e64dd1456864c Mon Sep 17 00:00:00 2001 From: Tomas Baca Date: Fri, 3 Nov 2023 12:47:30 +0100 Subject: [PATCH] updated example structure, added python example --- cpp/waypoint_flier/CMakeLists.txt | 2 +- cpp/waypoint_flier/config/dynparam.cfg | 4 ++-- .../launch/waypoint_flier.launch | 4 ++-- cpp/waypoint_flier/nodelets.xml | 2 +- cpp/waypoint_flier/package.xml | 7 ++----- cpp/waypoint_flier/src/waypoint_flier.cpp | 20 +++++++++---------- cpp/waypoint_flier/tmux/session.yml | 2 +- cpp/waypoint_flier_simple/CMakeLists.txt | 2 +- .../launch/waypoint_flier_simple.launch | 4 ++-- cpp/waypoint_flier_simple/nodelets.xml | 2 +- cpp/waypoint_flier_simple/package.xml | 7 ++----- .../src/waypoint_flier_simple.cpp | 6 +++--- cpp/waypoint_flier_simple/tmux/session.yml | 2 +- 13 files changed, 29 insertions(+), 35 deletions(-) diff --git a/cpp/waypoint_flier/CMakeLists.txt b/cpp/waypoint_flier/CMakeLists.txt index 6a8d3c7..c5b6a59 100644 --- a/cpp/waypoint_flier/CMakeLists.txt +++ b/cpp/waypoint_flier/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.15.0) -project(waypoint_flier) +project(example_waypoint_flier) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/cpp/waypoint_flier/config/dynparam.cfg b/cpp/waypoint_flier/config/dynparam.cfg index 597d42f..47a8c43 100755 --- a/cpp/waypoint_flier/config/dynparam.cfg +++ b/cpp/waypoint_flier/config/dynparam.cfg @@ -1,6 +1,6 @@ #!/usr/bin/env python -PACKAGE='waypoint_flier' +PACKAGE='example_waypoint_flier' import roslib; roslib.load_manifest(PACKAGE) @@ -11,4 +11,4 @@ params = gen.add_group("waypoint_flier parameters"); params.add("waypoint_idle_time", double_t, 1, "The time to wait before flying to the next waypoint", 1, 0, 60); -exit(gen.generate(PACKAGE, "waypoint_flier", "dynparam")) +exit(gen.generate(PACKAGE, "example_waypoint_flier", "dynparam")) diff --git a/cpp/waypoint_flier/launch/waypoint_flier.launch b/cpp/waypoint_flier/launch/waypoint_flier.launch index 9901bc4..370edad 100644 --- a/cpp/waypoint_flier/launch/waypoint_flier.launch +++ b/cpp/waypoint_flier/launch/waypoint_flier.launch @@ -20,13 +20,13 @@ - + - + diff --git a/cpp/waypoint_flier/nodelets.xml b/cpp/waypoint_flier/nodelets.xml index c664e48..13d2385 100644 --- a/cpp/waypoint_flier/nodelets.xml +++ b/cpp/waypoint_flier/nodelets.xml @@ -1,5 +1,5 @@ - + WaypointFlier nodelet diff --git a/cpp/waypoint_flier/package.xml b/cpp/waypoint_flier/package.xml index de947f8..c4b0139 100644 --- a/cpp/waypoint_flier/package.xml +++ b/cpp/waypoint_flier/package.xml @@ -1,9 +1,9 @@ - waypoint_flier + example_waypoint_flier 1.0.0 - waypoint_flier + The Example Waypoint Flier Matej Petrlik Matej Petrlik @@ -21,10 +21,7 @@ dynamic_reconfigure - - - diff --git a/cpp/waypoint_flier/src/waypoint_flier.cpp b/cpp/waypoint_flier/src/waypoint_flier.cpp index 07addda..84b9462 100644 --- a/cpp/waypoint_flier/src/waypoint_flier.cpp +++ b/cpp/waypoint_flier/src/waypoint_flier.cpp @@ -9,7 +9,7 @@ #include /* this header file is created during compilation from python script dynparam.cfg */ -#include +#include /* for smart pointers (do not use raw pointers) */ #include @@ -52,7 +52,7 @@ using vec2_t = mrs_lib::geometry::vec_t<2>; using vec3_t = mrs_lib::geometry::vec_t<3>; -namespace waypoint_flier +namespace example_waypoint_flier { /* class WaypointFlier //{ */ @@ -126,12 +126,12 @@ class WaypointFlier : public nodelet::Nodelet { // | ------------------- dynamic reconfigure ------------------ | - typedef waypoint_flier::dynparamConfig Config; - typedef dynamic_reconfigure::Server ReconfigureServer; - boost::recursive_mutex mutex_dynamic_reconfigure_; - boost::shared_ptr reconfigure_server_; - void callbackDynamicReconfigure(Config& config, uint32_t level); - waypoint_flier::dynparamConfig last_drs_config_; + typedef example_waypoint_flier::dynparamConfig Config; + typedef dynamic_reconfigure::Server ReconfigureServer; + boost::recursive_mutex mutex_dynamic_reconfigure_; + boost::shared_ptr reconfigure_server_; + void callbackDynamicReconfigure(Config& config, uint32_t level); + example_waypoint_flier::dynparamConfig last_drs_config_; // | --------------------- waypoint idling -------------------- | @@ -642,8 +642,8 @@ double WaypointFlier::distance(const mrs_msgs::Reference& waypoint, const geomet //} -} // namespace waypoint_flier +} // namespace example_waypoint_flier /* every nodelet must include macros which export the class as a nodelet plugin */ #include -PLUGINLIB_EXPORT_CLASS(waypoint_flier::WaypointFlier, nodelet::Nodelet); +PLUGINLIB_EXPORT_CLASS(example_waypoint_flier::WaypointFlier, nodelet::Nodelet); diff --git a/cpp/waypoint_flier/tmux/session.yml b/cpp/waypoint_flier/tmux/session.yml index 9e433d6..daddfeb 100644 --- a/cpp/waypoint_flier/tmux/session.yml +++ b/cpp/waypoint_flier/tmux/session.yml @@ -40,7 +40,7 @@ windows: - waypointflier: layout: tiled panes: - - waitForControl; roslaunch waypoint_flier waypoint_flier.launch + - waitForControl; roslaunch example_waypoint_flier waypoint_flier.launch - 'history -s rosservice call /$UAV_NAME/waypoint_flier/fly_to_first_waypoint' - 'history -s rosservice call /$UAV_NAME/waypoint_flier/start_waypoints_following' - 'history -s rosservice call /$UAV_NAME/waypoint_flier/stop_waypoints_following' diff --git a/cpp/waypoint_flier_simple/CMakeLists.txt b/cpp/waypoint_flier_simple/CMakeLists.txt index 5e51d73..98dabc8 100644 --- a/cpp/waypoint_flier_simple/CMakeLists.txt +++ b/cpp/waypoint_flier_simple/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.15.0) -project(waypoint_flier_simple) +project(example_waypoint_flier_simple) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/cpp/waypoint_flier_simple/launch/waypoint_flier_simple.launch b/cpp/waypoint_flier_simple/launch/waypoint_flier_simple.launch index 09b443c..05bd832 100644 --- a/cpp/waypoint_flier_simple/launch/waypoint_flier_simple.launch +++ b/cpp/waypoint_flier_simple/launch/waypoint_flier_simple.launch @@ -20,10 +20,10 @@ - + - + diff --git a/cpp/waypoint_flier_simple/nodelets.xml b/cpp/waypoint_flier_simple/nodelets.xml index 3b83172..56dc885 100644 --- a/cpp/waypoint_flier_simple/nodelets.xml +++ b/cpp/waypoint_flier_simple/nodelets.xml @@ -1,5 +1,5 @@ - + WaypointFlierSimple nodelet diff --git a/cpp/waypoint_flier_simple/package.xml b/cpp/waypoint_flier_simple/package.xml index 2a77e11..37f06e7 100644 --- a/cpp/waypoint_flier_simple/package.xml +++ b/cpp/waypoint_flier_simple/package.xml @@ -1,9 +1,9 @@ - waypoint_flier_simple + example_waypoint_flier_simple 1.0.0 - waypoint_flier_simple + Example for the Simple Waypoint Flier Daniel Hert Daniel Hert @@ -20,10 +20,7 @@ mrs_msgs - - - diff --git a/cpp/waypoint_flier_simple/src/waypoint_flier_simple.cpp b/cpp/waypoint_flier_simple/src/waypoint_flier_simple.cpp index 3e7201a..0db4037 100644 --- a/cpp/waypoint_flier_simple/src/waypoint_flier_simple.cpp +++ b/cpp/waypoint_flier_simple/src/waypoint_flier_simple.cpp @@ -17,7 +17,7 @@ #include //} -namespace waypoint_flier_simple +namespace example_waypoint_flier_simple { /* class WaypointFlierSimple //{ */ @@ -231,8 +231,8 @@ double WaypointFlierSimple::getRandomDouble(double min, double max) { //} -} // namespace waypoint_flier_simple +} // namespace example_waypoint_flier_simple /* every nodelet must include macros which export the class as a nodelet plugin */ #include -PLUGINLIB_EXPORT_CLASS(waypoint_flier_simple::WaypointFlierSimple, nodelet::Nodelet); +PLUGINLIB_EXPORT_CLASS(example_waypoint_flier_simple::WaypointFlierSimple, nodelet::Nodelet); diff --git a/cpp/waypoint_flier_simple/tmux/session.yml b/cpp/waypoint_flier_simple/tmux/session.yml index f5a36ef..3f3caec 100644 --- a/cpp/waypoint_flier_simple/tmux/session.yml +++ b/cpp/waypoint_flier_simple/tmux/session.yml @@ -40,7 +40,7 @@ windows: - waypointflier: layout: tiled panes: - - waitForControl; roslaunch waypoint_flier_simple waypoint_flier_simple.launch + - waitForControl; roslaunch example_waypoint_flier_simple waypoint_flier_simple.launch - 'history -s rosservice call /$UAV_NAME/waypoint_flier_simple/start' - rviz: layout: tiled