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' 不是内部或 ...
随机推荐
- vue - 封装input
input子组件 <el-input :value="value" placeholder="请输入内容" size="small" ...
- Ajax--jQuery使用Ajax
1.jQuery对Ajax操作进行了封装,在jQuery最底层的方法是$.ajax(),第二层是 load() , $.get() 和 $.post(),第三层是 $.getScript() 和 $. ...
- Maven项目- "null" 的java.lang.reflect.InvocationTargetException 解决方法
异常显示: 解决方法:
- 梯度下降法的python代码实现(多元线性回归)
梯度下降法的python代码实现(多元线性回归最小化损失函数) 1.梯度下降法主要用来最小化损失函数,是一种比较常用的最优化方法,其具体包含了以下两种不同的方式:批量梯度下降法(沿着梯度变化最快的方向 ...
- 二十一 JDK注解&注解案例
什么是注解? 注解和接口,类属于同一个级别 注解可以在变量.方法.类上加载 注解可以有属性也可以没有属性 注解是有作用范围(源码.编译期间,运行期间) 源码期间:例如String类上@Author ...
- 使用Vue 和 内网穿透:返回 invalid host header
原因:新版的webpack-dev-server出于安全考虑,默认检查hostname,如果它不是配置内的,将会中断访问. -------------------------------------- ...
- python2学习------基础语法4(模块)
1.整体结构层次(a.py,b.py) 目标:b.py文件中导入a.py里面定义的class A,并调用A类里面的属性或相关方法. 2.模块导入 <1> __init__.py < ...
- (译)Calculus on Computational Graphs: Backpropagation
Posted on August 31, 2015 Introduction Backpropagation is the key algorithm that makes training deep ...
- vue 路由过渡效果(1)
1.html界面 <transition name="slide"> <router-view></router-view> </tran ...
- 牛客小白月赛3---G 旅游(树形dp)
题目链接:https://www.nowcoder.com/acm/contest/87/G 分析: 1.对于点cur,dp[cur][0]表示在该点住宿:dp[cur][1]表示其某个子结点住宿,自 ...