them file geometry_msgs

This commit is contained in:
2025-11-06 17:01:17 +07:00
parent 827b8623bc
commit 05616f8fca
36 changed files with 562 additions and 67 deletions

View File

@@ -1,33 +1,8 @@
# Time of image acquisition, camera coordinate frame ID
Header header # Header timestamp should be acquisition time of image
uint32 height
uint32 width
string distortion_model
float64[] D
float64[9] K # 3x3 row-major matrix
float64[9] R # 3x3 row-major matrix
float64[12] P # 3x4 row-major matrix
uint32 binning_x
uint32 binning_y
RegionOfInterest roi
#pragma once
#include <string>
#include <vector>
#include "msg/Header.h"
#include "msg/RegionOfInterest.h"
#include "std_msgs/Header.h"
#include "sensor_msgs/RegionOfInterest.h"
namespace sensor_msgs
{

View File

@@ -1,7 +1,7 @@
#pragma once
#include <string>
#include <vector>
#include "msg/Header.h"
#include "std_msgs/Header.h"
namespace sensor_msgs
{

View File

@@ -1,5 +1,5 @@
#pragma once
#include "msg/Header.h"
#include "std_msgs/Header.h"
namespace sensor_msgs
{

View File

@@ -1,5 +1,5 @@
#pragma once
#include "msg/Header.h"
#include "std_msgs/Header.h"
namespace sensor_msgs
{

View File

@@ -2,7 +2,7 @@
#include <string>
#include <vector>
#include <cstdint>
#include "msg/Header.h"
#include "std_msgs/Header.h"
namespace sensor_msgs
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include <array>
#include "msg/Header.h"
#include "std_msgs/Header.h"
#include "geometry_msgs/Quaternion.h"
#include "geometry_msgs/Vector3.h"

View File

@@ -1,7 +1,7 @@
#pragma once
#include <string>
#include <vector>
#include "msg/Header.h"
#include "std_msgs/Header.h"
namespace sensor_msgs
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include <vector>
#include "msg/Header.h"
#include "std_msgs/Header.h"
namespace sensor_msgs
{

View File

@@ -2,8 +2,8 @@
#define MULTI_ECHO_LASER_SCAN_H
#include <vector>
#include "msg/Header.h"
#include "msg/LaserEcho.h" // Định nghĩa struct LaserEcho (float32[] echoes)
#include "std_msgs/Header.h"
#include "sensor_msgs/LaserEcho.h" // Định nghĩa struct LaserEcho (float32[] echoes)
namespace sensor_msgs
{

View File

@@ -2,7 +2,7 @@
#define RANGE_H
#include <cstdint>
#include "Header.h" // Header tương tự std_msgs/Header
#include "std_msgs/Header.h" // Header tương tự std_msgs/Header
namespace sensor_msgs
{

View File

@@ -2,7 +2,7 @@
#define RELATIVE_HUMIDITY_H
#include <cstdint>
#include "msg/Header.h" // Giả định bạn đã có struct Header tương tự ROS std_msgs/Header
#include "std_msgs/Header.h" // Giả định bạn đã có struct Header tương tự ROS std_msgs/Header
namespace sensor_msgs
{

View File

@@ -2,7 +2,7 @@
#define TEMPERATURE_H
#include <cstdint>
#include "msg/Header.h" // Định nghĩa struct Header tương tự std_msgs/Header
#include "std_msgs/Header.h" // Định nghĩa struct Header tương tự std_msgs/Header
namespace sensor_msgs
{

View File

@@ -2,7 +2,7 @@
#define TIMEREFERENCE_H
#include <string>
#include "msg/Header.h" // Định nghĩa struct Header tương tự std_msgs/Header
#include "std_msgs/Header.h" // Định nghĩa struct Header tương tự std_msgs/Header
namespace sensor_msgs
{

View File

@@ -40,20 +40,20 @@ int main()
getParams();
sensor_msgs::BatteryState battery;
battery.header = std_msgs::Header::now("battery_frame");
battery.voltage = 12.5f;
battery.current = -1.2f;
battery.percentage = 0.85f;
battery.power_supply_status = sensor_msgs::BatteryState::POWER_SUPPLY_STATUS_DISCHARGING;
// battery.header = std_msgs::Header::now("battery_frame");
// battery.voltage = 12.5f;
// battery.current = -1.2f;
// battery.percentage = 0.85f;
// battery.power_supply_status = sensor_msgs::BatteryState::POWER_SUPPLY_STATUS_DISCHARGING;
battery.cell_voltage = {4.15f, 4.18f, 4.12f};
battery.location = "slot_1";
battery.serial_number = "SN12345";
// battery.cell_voltage = {4.15f, 4.18f, 4.12f};
// battery.location = "slot_1";
// battery.serial_number = "SN12345";
std::cout << "Battery header timestamp: " << battery.header.stamp << "\n";
std::cout << "Battery voltage: " << battery.voltage << " V\n";
std::cout << "Status: " << static_cast<int>(battery.power_supply_status) << "\n";
std::cout << "Serial Number: " << battery.serial_number << "\n";
// std::cout << "Battery header timestamp: " << battery.header.stamp << "\n";
// std::cout << "Battery voltage: " << battery.voltage << " V\n";
// std::cout << "Status: " << static_cast<int>(battery.power_supply_status) << "\n";
// std::cout << "Serial Number: " << battery.serial_number << "\n";
sensor_msgs::JoyFeedbackArray feedback_array;
feedback_array.array.push_back(sensor_msgs::JoyFeedback{sensor_msgs::JoyFeedback::TYPE_BUZZER, 0, 5000.0f});
@@ -62,14 +62,14 @@ int main()
std::cout << "First feedback intensity: " << feedback_array.array[0].intensity << "\n";
sensor_msgs::PointCloud2 cloud;
cloud.header = std_msgs::Header::now("pointcloud_frame");
cloud.width = 100;
cloud.height = 1;
// cloud.header = std_msgs::Header::now("pointcloud_frame");
// cloud.width = 100;
// cloud.height = 1;
std::cout << "PointCloud2 header frame_id: " << cloud.header.frame_id << "\n";
std::cout << "PointCloud2 header timestamp: " << cloud.header.stamp << "\n";
std::cout << "PointCloud2 width: " << cloud.width << "\n";
std::cout << "PointCloud2 height: " << cloud.height << "\n";
// std::cout << "PointCloud2 header frame_id: " << cloud.header.frame_id << "\n";
// std::cout << "PointCloud2 header timestamp: " << cloud.header.stamp << "\n";
// std::cout << "PointCloud2 width: " << cloud.width << "\n";
// std::cout << "PointCloud2 height: " << cloud.height << "\n";
return 0;
}