在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

开启录制

bash 复制代码
# 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>的头文件

bash 复制代码
/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是后台运行一个终端

查看所有后台的终端

c 复制代码
screen -ls 

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

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

查看端口占用情况

c 复制代码
sudo lsof -i :11311

终止占用端口的进程

c 复制代码
sudo kill <PID>
  • 双目标定

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

bash 复制代码
# 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
bash 复制代码
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
c 复制代码
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:

Subscribers: None

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

Type: geometry_msgs/Vector3Stamped

Publishers:

Subscribers: None

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

Type: sensor_msgs/Image

Publishers:

Subscribers: None

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

Type: sensor_msgs/Image

Publishers:

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代码

相关推荐
月照银海似蛟龙2 天前
24年无人机行业资讯 | 12.23-12.29
无人机·行业资讯
创小董2 天前
成立一家无人机培训机构需要哪些基础配置
无人机
创小董2 天前
低空经济来袭,载人无人机研发技术详解
科技·无人机
创小董2 天前
无人机校园安保巡逻方案技术详解
科技·安全·无人机
GIS数据转换器2 天前
低空经济新动力:无人机航测技术的普及与应用
大数据·人工智能·物联网·无人机·智慧城市
云卓SKYDROID2 天前
无人机遥控器频率解析!
科技·无人机·科普·云卓科技·频率解析
创小董2 天前
无人机解码物流配送技术详解
无人机
云卓SKYDROID3 天前
无人机信道分配与频谱效率定义!
人工智能·计算机视觉·无人机·科普·云卓科技
创小董3 天前
无人机+无人车+无人船:海空地协同解决方案技术详解
系统架构·无人机