Skip to content

Commit

Permalink
[hugmy] add template for hugmy navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
sugikazu75 committed Jul 8, 2024
1 parent fce7ce4 commit 5298913
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
9 changes: 9 additions & 0 deletions robots/hugmy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@ include_directories(
include
${catkin_INCLUDE_DIRS}
)

add_library(hugmy_navigation src/navigation/hugmy_navigation.cpp)
target_link_libraries(hugmy_navigation ${catkin_LIBRARIES})

install(DIRECTORY config launch plugins
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
USE_SOURCE_PERMISSIONS
)

19 changes: 19 additions & 0 deletions robots/hugmy/include/hugmy/navigation/hugmy_navigation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include <aerial_robot_control/flight_navigation.h>

namespace aerial_robot_navigation
{
class HugmyNavigator : public BaseNavigator
{
public:
HugmyNavigator();
virtual ~HugmyNavigator() = default;

void initialize(ros::NodeHandle nh, ros::NodeHandle nhp,
boost::shared_ptr<aerial_robot_model::RobotModel> robot_model,
boost::shared_ptr<aerial_robot_estimation::StateEstimator> estimator,
double loop_du) override;
void update() override;
};
};
4 changes: 4 additions & 0 deletions robots/hugmy/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@
<run_depend>aerial_robot_simulation</run_depend>
<run_depend>pluginlib</run_depend>

<export>
<aerial_robot_control plugin="${prefix}/plugins/navigation_plugin.xml" />
</export>

</package>
5 changes: 5 additions & 0 deletions robots/hugmy/plugins/navigation_plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<library path="lib/libhugmy_navigation">
<class name="aerial_robot_navigation/hugmy_navigation" type="aerial_robot_navigation::HugmyNavigator" base_class_type="aerial_robot_navigation::BaseNavigator">
<description> hugmy navigation plugin </description>
</class>
</library>
27 changes: 27 additions & 0 deletions robots/hugmy/src/navigation/hugmy_navigation.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <hugmy/navigation/hugmy_navigation.h>

using namespace aerial_robot_navigation;

HugmyNavigator::HugmyNavigator():
BaseNavigator()
{
}


void HugmyNavigator::initialize(ros::NodeHandle nh, ros::NodeHandle nhp,
boost::shared_ptr<aerial_robot_model::RobotModel> robot_model,
boost::shared_ptr<aerial_robot_estimation::StateEstimator> estimator,
double loop_du)
{
/* initialize the flight control */
BaseNavigator::initialize(nh, nhp, robot_model, estimator, loop_du);
}

void HugmyNavigator::update()
{
BaseNavigator::update();
}

/* plugin registration */
#include <pluginlib/class_list_macros.h>
PLUGINLIB_EXPORT_CLASS(aerial_robot_navigation::HugmyNavigator, aerial_robot_navigation::BaseNavigator);

0 comments on commit 5298913

Please sign in to comment.