ROS省略source devel/setup.bash的方法

本文介绍了一种方法,用于避免每次启动ROS环境时手动加载工作空间的繁琐过程。通过编辑bashrc文件并添加source命令,可以实现自动加载指定的catkin_ws工作空间,简化了ROS项目的开发流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

为了不每次运行程序的时候都source一次devel文件夹里的setup.bash,可以打开主目录 按下Crtl+h 显示隐藏文件,双击打开bashrc文件,
在这里插入图片描述
在最后加入
source/home/############/catkin_ws/devel/setup.bash,其中###部分为你的计算机账户,保存后再重新打开终端,显示无错误即可。

Requirements The code is tested on clean Ubuntu 20.04 with ROS noetic installation. Install the required package toppra: sudo pip3 install toppra catkin_pkg PyYAML empy matplotlib pyrfc3339 Run the code 1. Download and compile the code git clone https://github.com/ZJU-FAST-Lab/Primitive-Planner.git cd Primitive-Planner catkin_make -DCMAKE_BUILD_TYPE=Release 2. Generate the motion primitive library cd src/scripts python3 swarm_path.py The generated motion primitive library is stored in "src/planner/plan_manage/primitive_library/". 3. Run the planner In the "Primitive-Planner/" directory: source devel/setup.bash # or setup.zsh cd src/scripts python3 gen_position_swap.py 20 # It will generate the swarm.launch with 20 drones roslaunch primitive_planner swarm.launch Wait until all the nodes have their launch process finished and keep printing "[FSM]: state: WAIT_TARGET. Waiting for trigger". Open another terminal, publish the trigger cd src/scripts bash pub_trigger.sh Then the drones (drone number is 40) will start to fly like this Change the drone number when executing "python3 gen_position_swap.py <drone_number>". Before starting the "roslaunch" command, please open another terminal and run "htop" to monitor the Memory usage and CPU usage. Each drone requires about 200 MB memory. Keep the htop opened for entire flight. The computation time is printed on the terminal in blue text, named as "plan_time". To get the accurate computation time, please fix the CPU frequency to its maximum by sudo apt install cpufrequtils sudo cpufreq-set -g performance Otherwise the CPU will run in powersave mode with low frequency. (根据上述代码帮我生成复现最适合在乌班图20.04复现的详细的实现过程和每一步的预期输出,需要安装的每个东西的乌班图20.04兼容版本,还有每一步是否需要创建虚拟环境,每一步是在创建的虚拟环境进行还是不进入虚拟环境的终端进行)
07-09
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值