作者在配置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的更多相关文章

  1. python 使用read_csv读取 CSV 文件时报错

    读取csv文件时报错 df = pd.read_csv('c:/Users/NUC/Desktop/成绩.csv' ) Traceback (most recent call last):  File ...

  2. 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 ...

  3. javah生成jni头文件时报错 Error: cannot access android.support...

    javah生成jni头文件时报错: Error: cannot access android.support.v7.app.AppCompatActivity class file for andro ...

  4. 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 ...

  5. Debug运行项目时报错,connected to the target VM, address: '127.0.0.1:50495', transport: 'socket'

    Debug运行项目时报错,无法进入Debug,猜想出错原因可能是未正确关闭IDEA. 解决方法,先直接运行项目,然后停掉项目,再用Debug模式启动,问题解决.

  6. python 读取文件时报错UnicodeDecodeError

    python 读取文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multib ...

  7. 命令行运行命令时报错You don&#39;t have write permissions for the /Library/***

    这是由于要运行这些操作时必须有管理员的权限(比方更新软件),比方更新cocoapods时报错 soindy:SmartThermo soindy$ gem install cocoapods Fetc ...

  8. 在英文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 ...

  9. bladex下载前端代码后,运行服务时报错【'vue-cli-service' 不是内部或外部命令,也不是可运行的程序或批处理文件。】的解决方法

    问题:E:\BladeXDB\Saber>yarn run serveyarn run v1.13.0$ vue-cli-service serve'vue-cli-service' 不是内部或 ...

随机推荐

  1. Centos7 网卡Device does not seem to be present解决办法

    1.ifconfig -a 查看当前所有网卡 2.修改网络配置文件 3.在原来文件的基础上,修改网卡名称 DEVICE=ens32 NAME=ens32 并且把UUID以及mac地址删掉 mv ifc ...

  2. sqlite帮助类

    帮助类 using System; using System.Collections.Generic; using System.Data; using System.Data.SQLite; usi ...

  3. python内置函数二

    issubclass(a,b)   判断a类是否属于b的子类    返回为布尔值 locals()   显示局部变量 max()   取最大值 min()   取最小值 zip()    拉链方法  ...

  4. CodeForces - 869C The Intriguing Obsession(组合数)

    题意:有三个集合,分别含有a.b.c个点,要求给这些点连线,也可以全都不连,每两点距离为1,在同一集合的两点最短距离至少为3的条件下,问有多少种连接方案. 分析: 1.先研究两个集合,若每两个集合都保 ...

  5. 51nod 1368:黑白棋 二分图最大匹配

    1368 黑白棋 题目来源: TopCoder 基准时间限制:1 秒 空间限制:131072 KB 分值: 160 难度:6级算法题  收藏  取消关注 有一个N*M的棋盘(1<=N,M< ...

  6. python 聚类分析 k均值算法

    dataSet = [ #数据集 # 1 [0.697, 0.460], # 2 [0.774, 0.376], # 3 [0.634, 0.264], # 4 [0.608, 0.318], # 5 ...

  7. Day6 - C - Count HYSBZ - 1452 /1452: [JSOI2009]Count

    Description 一个N*M的方格,初始时每个格子有一个整数权值,接下来每次有2个操作: 改变一个格子的权值 求一个子矩阵中某个特定权值出现的个数   Input 每一行有两个数字N,M 接下来 ...

  8. Day6 - A - HH的项链 HYSBZ - 1878

    ------------恢复内容开始------------ HH有一串由各种漂亮的贝壳组成的项链.HH相信不同的贝壳会带来好运,所以每次散步 完后,他都会随意取出一 段贝壳,思考它们所表达的含义.H ...

  9. 011.Delphi插件之QPlugins,延时加载服务

    这个DEMO是是把DLL插件的相关信息做成了一个配置文件,主程序加载这个配置文件,从而起到延时加载的作用 主程序代码如下 unit Frm_Main; interface uses Winapi.Wi ...

  10. BBS那些事儿

    目录 1 注册 2 登陆 3 图片验证码相关 4 首页相关,Django Admin后台录入数据 5 注销功能 6 修改密码 7 用户头像展示,media配置 8 个人站点,个人侧边栏 9 侧边栏筛选 ...