Big refactoring code

* Removal of unnecessary files
* Optimized multi-camera launch
* Explicitly list the parameters in the launch file
This commit is contained in:
默存
2023-02-06 17:26:10 +08:00
parent 04e4d4151e
commit 202719bd8c
59 changed files with 4931 additions and 806 deletions
+29
View File
@@ -0,0 +1,29 @@
#include <fcntl.h>
#include <semaphore.h>
#include <sys/shm.h>
#include <cstring>
#include <iostream>
#include "orbbec_camera/constants.h"
#include "rclcpp/rclcpp.hpp"
using namespace orbbec_camera;
int main() {
sem_t *sem = sem_open(DEFAULT_SEM_NAME.c_str(), O_CREAT, 0644, 0);
if (sem == SEM_FAILED) {
RCLCPP_ERROR_STREAM(rclcpp::get_logger("cleanup_shm"), "sem_open failed: " << strerror(errno));
return 1;
}
RCLCPP_INFO_STREAM(rclcpp::get_logger("cleanup_shm"), "sem_open succeeded");
sem_close(sem);
sem_unlink(DEFAULT_SEM_NAME.c_str());
RCLCPP_INFO_STREAM(rclcpp::get_logger("cleanup_shm"), "sem_unlink succeeded");
int shm_id = shmget(DEFAULT_SEM_KEY, 1, 0666 | IPC_CREAT);
if (shm_id != -1) {
shmctl(shm_id, IPC_RMID, nullptr);
RCLCPP_INFO_STREAM(rclcpp::get_logger("cleanup_shm"), "shmctl `IPC_RMID` succeeded");
}
return 0;
}