Learning High-Speed Flight in the Wild复现遇到的问题记录

环境安装

参考的这篇

编译遇到的问题

主要参考以下这几篇,很多问题都可以找到!

参考1
参考2
参考3

roslaunch agile_autonomy simulation.launch 中的问题

  1. Couldn’t open joystick /dev/input/js0. Will retry every second.
    看到大佬说是因为没有连接手柄这种,非致命错误,可以忽略。

  2. no CUDA-capable device is detected 109
    有一个问题,和上面参考的里的差不多

[ERROR] [1648602370.270104353, 294.864000000]: no CUDA-capable device is detected 109

nvidia-smi 后也失败

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
sudo dkms install -m nvidia-srv -v 5……(版本号,忘记了)

也报错,可以参考这篇解决

  1. no kernel image is available for execution on the device 209
    说是显卡算力不匹配,可以降低,但还没有尝试,参考

python test_trajectories.py --settings_file=config/test_settings.yaml 中的问题

  1. 报了很多这个错误
[ERROR] [1671867679.561045, 1679.064000]: bad callback: <bound method PlanBase.callback_depth of <PlannerLearning.PlannerLearning.PlanLearning object at 0x7f97d2d35b20>>
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/home/freq/agile_autonomy_ws/catkin_aa/src/agile_autonomy/planner_learning/src/PlannerLearning/PlannerBase.py", line 206, in callback_depth
    depth = self.bridge.imgmsg_to_cv2(data, '16UC1')
  File "/opt/ros/noetic/lib/python3/dist-packages/cv_bridge/core.py", line 163, in imgmsg_to_cv2
    dtype, n_channels = self.encoding_to_dtype_with_channels(img_msg.encoding)
  File "/opt/ros/noetic/lib/python3/dist-packages/cv_bridge/core.py", line 99, in encoding_to_dtype_with_channels
    return self.cvtype2_to_dtype_with_channels(self.encoding_to_cvtype2(encoding))
  File "/opt/ros/noetic/lib/python3/dist-packages/cv_bridge/core.py", line 91, in encoding_to_cvtype2
    from cv_bridge.boost.cv_bridge_boost import getCvType
ImportError: /lib/x86_64-linux-gnu/libp11-kit.so.0: undefined symbol: ffi_type_pointer, version LIBFFI_BASE_7.0

解决方法:重新编译cv_bridge,里面有一段,如果报错,可以看看这篇
如果在编译阶段报错关于boost的报错,可以看看这个
记得make clean(make clean如果失败
如果编译成功后,还是报错,可以参考这篇的评论区,把/agile_autonomy_ws/catkin_aa/src/agile_autonomy/planner_learning/src/PlannerLearning/PlannerBase.py中下面函数的代码修改一下,有两处

def callback_image(self, data):
        '''
        Reads an image and generates a new plan.
        '''
        try:
            # print("current version of python is: ", sys.version)
            print("current data is: ",data, type(data))
            # image = np.frombuffer(data.data, dtype=np.uint8).reshape(image_data.height, image_data.width, -1)
            # image = self.bridge.imgmsg_to_cv2(data, "bgr8")
            if self.quad_name == 'hawk':
                image = cv2.flip(image, -1)  # passing a negative axis index flips both axes
            if np.sum(image) != 0:
                self.image = self.preprocess_img(image)
        except CvBridgeError as e:
            print(e)
    def callback_depth(self, data):
            '''
            Reads a depth image and saves it.
            '''
            try:
                if self.quad_name == 'hummingbird':
                    # print("current python version is: ",sys.version)
                    # print("data is: ", type(data)) # (480,640,2), <class 'sensor_msgs.msg._Image.Image'>
                    depth = np.frombuffer(data.data, dtype=np.uint16).reshape(data.height, data.width,-1)#[:,:,0] 
                    # depth = cv2.cvtColor(depth,cv2.COLOR_RGB2BGR)
                    # print("depth shape is: ",{depth.shape})   # {(480,640)}
                    # depth = self.bridge.imgmsg_to_cv2(data, '16UC1')  # 16-bit grayscale image
                    # print("============================================================")
                    # print("Min Depth {}. Max Depth {}. with Nans {}".format(np.min(depth),
                    #                                                        np.max(depth),
  1. NameError: name ‘open’ is not defined
    参考了这篇
--- Logging error ---
Traceback (most recent call last):
  File "/home/freq/anaconda3/envs/tf_24/lib/python3.8/logging/handlers.py", line 69, in emit
    if self.shouldRollover(record):
  File "/home/freq/anaconda3/envs/tf_24/lib/python3.8/logging/handlers.py", line 183, in shouldRollover
    self.stream = self._open()
  File "/home/freq/anaconda3/envs/tf_24/lib/python3.8/logging/__init__.py", line 1176, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
NameError: name 'open' is not defined

其实这个之前没解决,但在解决上一个问题后,后面就没见到报错了。

运行程序

cd agile_autonomy_ws
source catkin_aa/devel/setup.bash
roslaunch agile_autonomy simulation.launch

再开一个终端

cd agile_autonomy_ws
source catkin_aa/devel/setup.bash
conda activate tf_24
cd /home/freq/agile_autonomy_ws/catkin_aa/src/agile_autonomy/planner_learning
python test_trajectories.py --settings_file=config/test_settings.yaml
  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Free...

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值