< >
Home » Crazyflie入门教程 » crazyflie入门教程-安装crazyswarm2

crazyflie入门教程-安装crazyswarm2

说明:

  • 介绍如何安装crazyswarm2

  • 使用环境:

    ubuntu:22.04
    ros:humble

相关设备

步骤:

  • 安装相关依赖
sudo apt install libboost-program-options-dev libusb-1.0-0-dev
pip3 install rowan nicegui
sudo apt-get install ros-humble-motion-capture-tracking
pip3 install cflib transforms3d
sudo apt-get install ros-humble-tf-transformations
  • 安装crazyswarm2
mkdir -p ros2_ws/src
cd ros2_ws/src
git clone https://github.com/IMRCLab/crazyswarm2 --recursive
  • 需要修改 crazyflie/script/crazyflie_server.py 的 代码:
def __init__(self):
    self.world_tf_name = "map"


self.swarm.query_all_values_on_connect = self._ros_parameters['all']["firmware_params"]["query_all_values_on_connect"]


def _log_odom_data_callback(self, timestamp, data, logconf, uri):
    msg.child_frame_id = cf_name + '/odom'


def _log_pose_data_callback(self, timestamp, data, logconf, uri):
    t_base.child_frame_id = cf_name + '/odom' 
  • 编译
cd ../
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
  • 安装crazyflie-firmware
git clone --recursive https://github.com/bitcraze/crazyflie-firmware.git
cd crazyflie-firmware
git submodule init
git submodule update
make cf2_defconfig
make -j 12
make tag_defconfig
make -j 12
  • 配置环境
vim ~/.bashrc

export PYTHONPATH=/home/bitcraze/crazyflie-firmware/build:$PYTHONPATH

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: none