ROS常见问题(二) 运行文件时报错environment variable ' ###_MODEL' is not set
作者在配置pibot机器人时报错:
Invalid <arg> tag: environment variable 'PIBOT_MODEL' is not set.
Arg xml is <arg default="$(env PIBOT_MODEL)" doc="model type [apollo, zeus, hades, hera]" name="model"/>
The traceback for the exception was written to the log file
解决方案:
环境未配置
配置环境即可
./pibot_init_env.sh
source ~/.bashrc
其中,pibot_init_env.sh文件源码如下:
#!/bin/bash if ! [ $PIBOT_ENV_INITIALIZED ]; then
echo "export PIBOT_ENV_INITIALIZED=1" >> ~/.bashrc
echo "source ~/.pibotrc" >> ~/.bashrc #rules
echo "setup pibot modules"
echo " "
sudo cp rules/pibot.rules /etc/udev/rules.d
sudo cp rules/rplidar.rules /etc/udev/rules.d
sudo cp rules/ydlidar.rules /etc/udev/rules.d
sudo cp rules/orbbec.rules /etc/udev/rules.d
echo " "
echo "Restarting udev"
echo ""
sudo service udev reload
sudo service udev restart
fi code_name=$(lsb_release -sc) if [ "$code_name" = "trusty" ]; then
ros_version="indigo"
elif [ "$code_name" = "xenial" ]; then
ros_version="kinetic"
else
echo "PIBOT not support "$code_name
exit
fi echo "source /opt/ros/${ros_version}/setup.bash" > ~/.pibotrc #LOCAL_IP=`ifconfig eth0|grep "inet addr:"|awk -F":" '{print $2}'|awk '{print $1}'`
#LOCAL_IP=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | awk -F"/" '{print $1}'` #if [ ! ${LOCAL_IP} ]; then
# echo "please check network"
# exit
#fi LOCAL_IP=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | awk -F"/" '{print $1}'`
echo "LOCAL_IP=\`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print \$2}' | awk -F"/" '{print \$1}'\`" >> ~/.pibotrc if [ ! ${LOCAL_IP} ]; then
echo "please check network"
exit
fi read -p "please specify pibot model(0:apollo,1:apolloX,2:zeus,3:hera,4:hades,other for user defined):" PIBOT_MODEL_INPUT if [ "$PIBOT_MODEL_INPUT" = "" ]; then
PIBOT_MODEL='apollo'
elif [ "$PIBOT_MODEL_INPUT" = "" ]; then
PIBOT_MODEL='apolloX'
elif [ "$PIBOT_MODEL_INPUT" = "" ]; then
PIBOT_MODEL='zeus'
elif [ "$PIBOT_MODEL_INPUT" = "" ]; then
PIBOT_MODEL='hera'
elif [ "$PIBOT_MODEL_INPUT" = "" ]; then
PIBOT_MODEL='hades'
else
PIBOT_MODEL=$PIBOT_MODEL_INPUT
fi read -p "please specify your pibot lidar(0:rplidar,1:rplidar-a3,2:eai-x4,3:eai-g4,4:xtion,5:astra,6:kinectV1,other for user defined):" PIBOT_LIDAR_INPUT if [ "$PIBOT_LIDAR_INPUT" = "" ]; then
PIBOT_LIDAR='rplidar'
elif [ "$PIBOT_LIDAR_INPUT" = "" ]; then
PIBOT_LIDAR='rplidar-a3'
elif [ "$PIBOT_LIDAR_INPUT" = "" ]; then
PIBOT_LIDAR='eai-x4'
elif [ "$PIBOT_LIDAR_INPUT" = "" ]; then
PIBOT_LIDAR='eai-g4'
elif [ "$PIBOT_LIDAR_INPUT" = "" ]; then
PIBOT_LIDAR='xtion'
elif [ "$PIBOT_LIDAR_INPUT" = "" ]; then
PIBOT_LIDAR='astra'
elif [ "$PIBOT_LIDAR_INPUT" = "" ]; then
PIBOT_LIDAR='kinectV1'
else
PIBOT_LIDAR=$PIBOT_LIDAR_INPUT
fi echo "export ROS_IP=\`echo \$LOCAL_IP\`" >> ~/.pibotrc
echo "export ROS_HOSTNAME=\`echo \$LOCAL_IP\`" >> ~/.pibotrc
echo "export PIBOT_MODEL=${PIBOT_MODEL}" >> ~/.pibotrc
echo "export PIBOT_LIDAR=${PIBOT_LIDAR}" >> ~/.pibotrc read -p "please select specify the current machine(ip:$LOCAL_IP) type(0:onboard,other:remote):" PIBOT_MACHINE_VALUE
if [ "$PIBOT_MACHINE_VALUE" = "" ]; then
ROS_MASTER_IP_STR="\`echo \$LOCAL_IP\`"
ROS_MASTER_IP=`echo $LOCAL_IP`
else
read -p "plase specify the onboard machine ip for commnicationi:" PIBOT_ONBOARD_MACHINE_IP
ROS_MASTER_IP_STR=`echo $PIBOT_ONBOARD_MACHINE_IP`
ROS_MASTER_IP=`echo $PIBOT_ONBOARD_MACHINE_IP`
fi echo "export ROS_MASTER_URI=`echo http://${ROS_MASTER_IP_STR}:11311`" >> ~/.pibotrc echo "*****************************************************************"
echo "model: " $PIBOT_MODEL
echo "lidar:" $PIBOT_LIDAR
echo "local_ip: " ${LOCAL_IP}
echo "onboard_ip:" ${ROS_MASTER_IP}
echo ""
echo "please execute source ~/.bashrc to make the configure effective"
echo "*****************************************************************" echo "source ~/pibot_ros/ros_ws/devel/setup.bash" >> ~/.pibotrc #alias
echo "alias pibot_bringup='roslaunch pibot_bringup bringup.launch'" >> ~/.pibotrc
echo "alias pibot_bringup_with_imu='roslaunch pibot_bringup bringup_with_imu.launch'" >> ~/.pibotrc
echo "alias pibot_lidar='roslaunch pibot_bringup ${PIBOT_LIDAR}.launch'" >> ~/.pibotrc
echo "alias pibot_base='roslaunch pibot_bringup robot.launch'" >> ~/.pibotrc
echo "alias pibot_base_with_imu='roslaunch pibot_bringup robot_with_imu.launch'" >> ~/.pibotrc
echo "alias pibot_control='roslaunch pibot keyboard_teleop.launch'" >> ~/.pibotrc echo "alias pibot_gmapping='roslaunch pibot_navigation gmapping.launch'" >> ~/.pibotrc
echo "alias pibot_gmapping_with_imu='roslaunch pibot_navigation gammaping_with_imu.launch'" >> ~/.pibotrc
echo "alias pibot_save_map='roslaunch pibot_navigation save_map.launch'" >> ~/.pibotrc echo "alias pibot_naviagtion='roslaunch pibot_navigation nav.launch'" >> ~/.pibotrc
echo "alias pibot_naviagtion_with_imu='roslaunch pibot_navigation nav_with_imu.launch'" >> ~/.pibotrc
echo "alias pibot_view='roslaunch pibot_navigation view_nav.launch'" >> ~/.pibotrc echo "alias pibot_cartographer='roslaunch pibot_navigation cartographer.launch'" >> ~/.pibotrc
echo "alias pibot_view_cartographer='roslaunch pibot_navigation view_cartographer.launch'" >> ~/.pibotrc echo "alias pibot_hector_mapping='roslaunch pibot_navigation hector_mapping.launch'" >> ~/.pibotrc
echo "alias pibot_hector_mapping_without_imu='roslaunch pibot_navigation hector_mapping_without_odom.launch'" >> ~/.pibotrc echo "alias pibot_karto_slam='roslaunch pibot_navigation karto_slam.launch'" >> ~/.pibotrc
其他出现类似报错的可以参考上面的代码直接把环境变量加到~/.bashrc里面。
ROS常见问题(二) 运行文件时报错environment variable ' ###_MODEL' is not set的更多相关文章
- python 使用read_csv读取 CSV 文件时报错
读取csv文件时报错 df = pd.read_csv('c:/Users/NUC/Desktop/成绩.csv' ) Traceback (most recent call last): File ...
- python 读取文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multib
python 读取文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multib ...
- javah生成jni头文件时报错 Error: cannot access android.support...
javah生成jni头文件时报错: Error: cannot access android.support.v7.app.AppCompatActivity class file for andro ...
- python读取txt文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x8e in position 8: illegal multibyte sequence
python读取文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x8e in position 8: illegal multibyte ...
- Debug运行项目时报错,connected to the target VM, address: '127.0.0.1:50495', transport: 'socket'
Debug运行项目时报错,无法进入Debug,猜想出错原因可能是未正确关闭IDEA. 解决方法,先直接运行项目,然后停掉项目,再用Debug模式启动,问题解决.
- python 读取文件时报错UnicodeDecodeError
python 读取文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multib ...
- 命令行运行命令时报错You don't have write permissions for the /Library/***
这是由于要运行这些操作时必须有管理员的权限(比方更新软件),比方更新cocoapods时报错 soindy:SmartThermo soindy$ gem install cocoapods Fetc ...
- 在英文Windows操作系统上使用SQL Server Management Studio(SSMS)导入Excel 97-2003文件时报错:Failure creating file
今天在公司服务器上使用SQL Server Management Studio(SSMS)导入Excel 97-2003文件(.xls)时报错: Failure creating file. (Mic ...
- bladex下载前端代码后,运行服务时报错【'vue-cli-service' 不是内部或外部命令,也不是可运行的程序或批处理文件。】的解决方法
问题:E:\BladeXDB\Saber>yarn run serveyarn run v1.13.0$ vue-cli-service serve'vue-cli-service' 不是内部或 ...
随机推荐
- 关于dotnet跨平台 微信公众号
dotNET跨平台 <dotNET跨平台>是国内首个以.NET程序员.技术文化.新闻为主题的公众号,拥有超过6万读者.在这里你可以谈微软.NET,Mono的跨平台开发技术,也可以谈谈其他的 ...
- Html5使用audio播放音乐
html代码 <audio id="myaudio" src="http://ws.stream.qqmusic.qq.com/C100003R74Cn0JR4O ...
- 几款Java模板引擎的性能评测
参评的几款模板引擎为:XMLTemplate(简称XT)Velocity(简称VT)CommonTemplate(简称CT)FreeMarker(简称FT)Smarty4j(简称ST)直接的java代 ...
- AngularJs 禁止模板缓存
因为AngularJs的特性(or 浏览器本身的缓存?),angular默认的HTML模板加载都会被缓存起来.导致每次修改完模板之后都得经常需要清除浏览器的缓存来保证浏览器去获得最新的html模板,自 ...
- Vue + Webpack 根据不同环境打包
修改 prod.env.js // 当前正在运行的脚本名称 const TARGET = process.env.npm_lifecycle_event // 第一个参数 let argv = pro ...
- jquery解析
OutOfMemory.CN β 聚客 代码 专栏 教程 Maven Gitter 标签 登录注册 好书:重构 改善既有代码的设计[京东 亚马逊] | 敏捷软件开发原则.模式与实践[京东 亚 ...
- lambda表达式-很好---《转载》
Lambda表达式详解 前言 1.天真热,程序员活着不易,星期天,也要顶着火辣辣的太阳,总结这些东西. 2.夸夸lambda吧:简化了匿名委托的使用,让你让代码更加简洁,优雅.据说它是微软自c#1.0 ...
- 小程序导航组件navigator活学活用
小程序开发中必不可少的组件navigator,虽然使用频率非常高,但是却没多少人能灵活运用. 先说navigator组件的用处: 它的主要用处是跳转执行,跳转可分为当前页面内跳转.前往页面外部的跳转. ...
- python isinstance()判断数据类型
举例: d = (1,2,3) print(isinstance(d,int)) #False print(isinstance(d,tuple)) #True print(isinstance(d, ...
- Azure Cognitive Services- Speech To Text
Speech 服务是认知服务的一种,提供了语音转文本,文本转语音, 语音翻译等,今天我们实战的是语音转文本(Speech To Text). STT支持两种访问方式,1.是SDK,2.是REST AP ...