add beacon positioning node
This commit is contained in:
22
.vscode/c_cpp_properties.json
vendored
Normal file
22
.vscode/c_cpp_properties.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"browse": {
|
||||
"databaseFilename": "",
|
||||
"limitSymbolsToIncludedHeaders": true
|
||||
},
|
||||
"includePath": [
|
||||
"/opt/ros/humble/include/**",
|
||||
"/home/ubuntu/ros2_ws/src/beacon_positioning/include/**",
|
||||
"/usr/include/**"
|
||||
],
|
||||
"name": "ROS",
|
||||
"intelliSenseMode": "gcc-x64",
|
||||
"compilerPath": "/usr/bin/gcc",
|
||||
"cStandard": "c11",
|
||||
"cppStandard": "c++14",
|
||||
"configurationProvider": "ms-vscode.cmake-tools"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"ros.distro": "humble"
|
||||
}
|
||||
@@ -21,9 +21,10 @@ find_package(ament_cmake REQUIRED)
|
||||
# further dependencies manually.
|
||||
# find_package(<dependency> REQUIRED)
|
||||
find_package(rclcpp REQUIRED)
|
||||
find_package(std_msgs REQUIRED)
|
||||
|
||||
add_executable(tracker_position src/tracker_position.cpp)
|
||||
ament_target_dependencies(tracker_position rclcpp)
|
||||
ament_target_dependencies(tracker_position rclcpp std_msgs)
|
||||
|
||||
target_include_directories(tracker_position PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
<name>beacon_positioning</name>
|
||||
<version>0.0.0</version>
|
||||
<description>ROS 2 package to read the Terabee Robot Positioning System beacons positions</description>
|
||||
<maintainer email="semmer99@gmail.com">ubuntu</maintainer>
|
||||
<maintainer email="semmer99@gmail.com">sem</maintainer>
|
||||
<license>Apache License 2.0</license>
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
<depend>rclcpp</depend>
|
||||
<depend>std_msgs</depend>
|
||||
|
||||
<test_depend>ament_lint_auto</test_depend>
|
||||
<test_depend>ament_lint_common</test_depend>
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
#include <cstdio>
|
||||
#include <chrono>
|
||||
|
||||
#include "rclcpp/rclcpp.hpp"
|
||||
#include "std_msgs/msg/string.hpp"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
class BeaconPositioningPublisher : public rclcpp::Node
|
||||
{
|
||||
public:
|
||||
BeaconPositioningPublisher() : Node("beacon_positioning_publisher") {
|
||||
publisher_ = this->create_publisher<std_msgs::msg::String>("beacon_positioning", 10);
|
||||
timer_ = this->create_wall_timer(
|
||||
500ms, std::bind(&BeaconPositioningPublisher::timer_callback, this));
|
||||
}
|
||||
private:
|
||||
void timer_callback() {
|
||||
auto message = std_msgs::msg::String();
|
||||
message.data = "Hello beacons!";
|
||||
RCLCPP_INFO(this->get_logger(), "Publishing: '%s'", message.data.c_str());
|
||||
publisher_->publish(message);
|
||||
}
|
||||
rclcpp::TimerBase::SharedPtr timer_; // timer to trigger the
|
||||
rclcpp::Publisher<std_msgs::msg::String>::SharedPtr publisher_; // pointer to publisher object
|
||||
};
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
@@ -7,5 +31,9 @@ int main(int argc, char ** argv)
|
||||
(void) argv;
|
||||
|
||||
printf("hello world beacon_positioning package\n");
|
||||
|
||||
rclcpp::init(argc, argv);
|
||||
rclcpp::spin(std::make_shared<BeaconPositioningPublisher>());
|
||||
rclcpp::shutdown();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Submodule src/px4_msgs updated: 4db0a3f14e...b64ef0475c
Submodule src/px4_ros_com updated: 0bcf68bcb6...1562ff30d5
Reference in New Issue
Block a user