当前位置: 首页 > article >正文

在DJI无人机上运行VINS-FUISON(PSDK 转 ROS)

安装ceres出现以下报错,将2版本的ceres换成1版本的ceres

CMake did not find one.

  Could not find a package configuration file provided by "absl" with any of
  the following names:

    abslConfig.cmake
    absl-config.cmake

  Add the installation prefix of "absl" to CMAKE_PREFIX_PATH or set
  "absl_DIR" to a directory containing one of the above files.  If "absl"
  provides a separate development package or SDK, be sure it has been
  installed.

衔接桥梁

dajiang SDK psdk
https://developer.dji.com/doc/payload-sdk-api-reference/cn/

psdk->ros2
https://github.com/umdlife/psdk_ros2
https://umdlife.github.io/psdk_ros2/api/library_root.html

ros2 <-> ros1
ros1_bridge

ROS 1 和 ROS 2 的环境变量不能同时写入 .bashrc 文件中,因为它们的环境变量会相互冲突=>>手动切换环境

sudo apt update
sudo apt install ros-galactic-ros1-bridge

https://blog.csdn.net/2302_80225397/article/details/141167175

开启录制

# 1
screen
sudo su

cd /home/nvidia/psdk_ros2
sh /home/nvidia/change_device_mode.sh 

source /opt/ros/galactic/setup.bash 
source install/setup.bash 
ros2 launch psdk_wrapper wrapper.launch.py 

# 2
screen 
cd /home/nvidia/psdk_ros2
source /opt/ros/galactic/setup.bash 
source install/setup.bash 
ros2 service call /wrapper/psdk_ros2/start_perception psdk_interfaces/srv/PerceptionStereoVisionSetup \
    "{stereo_cameras_direction: 'FRONT', start_stop: true}"

DATE_STR=$(date +%Y%m%d_%H%M%S)

ros2 bag record -o outputs/$DATE_STR \
    /wrapper/psdk_ros2/acceleration_body_raw \
    /wrapper/psdk_ros2/angular_rate_body_raw \
    /wrapper/psdk_ros2/perception_stereo_left_stream \
    /wrapper/psdk_ros2/perception_stereo_right_stream 

## ros2 bag to ros1
rosbags-convert outputs/$DATE_STR --dst $DATE_STR.bag

标定

  • IMU标定

IMU标定参考港科大imu_utils框架:https://blog.csdn.net/qq_35616298/article/details/116190164

要先下载code_util编译,再下载imu_utils

code_util可能出现opencv版本号不符合的报错,更换opencv写法

注意:当工作空间里面有非ros包时,要用catkin_make_isolated,而非catkin_make

编译imu_utils出现以下报错,在mu_an.cpp加入#include <fstream>的头文件

/home/liuchengyi/imuCali_ws/src/imu_utils/src/imu_an.cpp:90:19: error: aggregate ‘std::ofstream out_t’ has incomplete type and cannot be defined
   90 |     std::ofstream out_t;
  • screen是后台运行一个终端

查看所有后台的终端

screen -ls 

关闭某个名为172199.pts-1.nvidia-desktop的终端

screen -X -S 172199.pts-1.nvidia-desktop quit  
  • 远程拷贝录制bag
scp 20250103_102425.bag liuchengyi@192.168.111.171:/home/liuchengyi/Desktop
  • vscode远程连接断掉
fn + f1重启
  • roscore端口占用

查看端口占用情况

sudo lsof -i :11311

终止占用端口的进程

sudo kill <PID>
  • 双目标定

https://blog.csdn.net/m0_71523511/article/details/139969032

# d435
kalibr_calibrate_cameras --target checkerboard.yaml --bag mult_cam_d435i.bag 
--models pinhole-radtan pinhole-radtan pinhole-radtan --topics /color /infra_left /infra_right
#t265
kalibr_calibrate_cameras --target checkerboard.yaml --bag camer_t265.bag 
--models omni-radtan omni-radtan --topics /fisheye1 /fisheye2
#stereo
rosrun kalibr kalibr_calibrate_cameras --target src/kalibr/april_6_6.yaml --bag src/kalibr/stereo_4hz.bag 
--models pinhole-radtan pinhole-radtan --topics /image_raw_right /image_raw_right --show-extraction

source ~/Desktop/kalibr_ws/devel/setup.bash 
rosrun kalibr kalibr_calibrate_cameras --target ~/Desktop/kalibr_ws/src/apriltag.yaml --bag ~/Desktop/20250103_155443.bag --models pinhole-radtan pinhole-radtan --topics /wrapper/psdk_ros2/perception_stereo_left_stream /wrapper/psdk_ros2/perception_stereo_right_stream  --approx-sync 0.01
kalibr_calibrate_imu_camera --target ~/Desktop/kalibr_ws/src/apriltag.yaml --cam camchain-mult_cam_d435i.yaml --imu imu.yaml --bag imu_stereo.bag

foxglove
https://foxglove.dev/download

在这里插入图片描述

写一个代码,有以下话题liuchengyi@dominant-dev:~/Desktop$ rostopic info /wrapper/psdk_ros2/acceleration_body_raw
Type: geometry_msgs/AccelStamped

Publishers:

  • /play_1735895885787424218 (http://dominant-dev:36033/)

Subscribers: None

liuchengyi@dominant-dev:~/Desktop$ rostopic info /wrapper/psdk_ros2/angular_rate_body_raw
Type: geometry_msgs/Vector3Stamped

Publishers:

  • /play_1735895885787424218 (http://dominant-dev:36033/)

Subscribers: None

liuchengyi@dominant-dev:~/Desktop$ rostopic info /wrapper/psdk_ros2/perception_stereo_left_stream
Type: sensor_msgs/Image

Publishers:

  • /play_1735895885787424218 (http://dominant-dev:36033/)

Subscribers: None

liuchengyi@dominant-dev:~/Desktop$ rostopic info /wrapper/psdk_ros2/perception_stereo_left_stream
Type: sensor_msgs/Image

Publishers:

  • /play_1735895885787424218 (http://dominant-dev:36033/)

Subscribers: None
帮我把/wrapper/psdk_ros2/acceleration_body_raw和/wrapper/psdk_ros2/angular_rate_body_raw数据合并成 sensor_msgs/Imu类型的名为/dji/imu话题的数据,并且把/wrapper/psdk_ros2/perception_stereo_left_stream和/wrapper/psdk_ros2/perception_stereo_right_stream分别改名为/dji/left/camera和/dji/right/camera名称的同类型Image话题发布,并且把新生成的三个话题存储到rosbag中,完成python代码


http://www.kler.cn/a/467976.html

相关文章:

  • AI在电子制造中的应用:预测质量控制
  • Java 关键字【synchronized】
  • 外网访问本地部署的 VMware ESXi 服务
  • Jetpack Compose 学习笔记(四)—— CompositionLocal 与主题
  • reactor中的并发
  • 使用 C++ 和函数式编程构建高效的 AI 模型
  • leetcode-------mysql
  • PyTorch快速入门教程【小土堆】之优化器
  • STM32 拓展 低功耗案例3:待机模式 (register)
  • SZY206-2016水资源监测数据传输规约 基础架构
  • 深入解析 Redisson 分布式限流器 RRateLimiter 的原理与实现
  • python识别outlook邮件并且将pdf文件作为附件发送邮件
  • 矩阵运算提速——玩转opencv::Mat
  • 电脑键盘打不了字是何原因,如何解决呢
  • 软件需求规格是什么
  • CSS——4. 行内样式和内部样式(即CSS引入方式)
  • 连接Milvus
  • Apache PDFBox添加maven依赖,pdf转成图片
  • 人工智能(AI)简史:推动新时代的科技力量
  • 详解MySQL SQL删除(超详,7K,含实例与分析)
  • PaperAssistant:使用Microsoft.Extensions.AI实现
  • Uniapp中使用`wxml-to-canvas`开发DOM生成图片功能
  • Traceroute 网络诊断工具实战详解
  • 中高级运维工程师运维面试题(九)之 Apache Pulsar
  • MySQL优化器估算SQL语句访问行数的深入分析
  • MIPI_DPU 综合(DPU+MIPI+Demosaic+VDMA 通路)