.bashrc文件: ros环境变量设置


source /opt/ros/indigo/setup.bash


######  kobuki_slam

source /opt/ros/indigo/setup.bash
source /home/yhzhao/catkin_ws/devel/setup.bash
source /home/yhzhao/hl_ws/devel/setup.bash

#export ROS_PACKAGE_PATH=~/catkin_ws/src:$ROS_PACKAGE_PATH
export ROS_PACKAGE_PATH=~/catkin_ws/src:~/hl_ws/src:$ROS_PACKAGE_PATH
export ROS_WORKSPACE=~/hl_ws/src
 
alias sbpi='ssh bananapi@192.168.1.102'
alias bpi_ros='export ROS_MASTER_URI=http://192.168.1.102:11311 && export ROS_HOSTNAME=192.168.1.123'
alias cdros='cd ~/catkin_ws/src'


declare -x TURTLEBOT_GAZEBO_MAP_FILE="/opt/ros/indigo/share/turtlebot_gazebo/maps/corridor.yaml"
declare -x TURTLEBOT_GAZEBO_WORLD_FILE="/opt/ros/indigo/share/turtlebot_gazebo/worlds/corridor.world"


export TURTLEBOT_BASE=kobuki
export TURTLEBOT_STACKS=nostack
export TURTLEBOT_3D_SENSOR=rplidar

######  slam_ws
source /opt/ros/indigo/setup.bash
source /home/yhzhao/slam_ws/devel/setup.bash

export ROS_PACKAGE_PATH=~/slam_ws/src:$ROS_PACKAGE_PATH
export ROS_WORKSPACE=~/slam_ws/src


#export ROS_HOSTNAME=192.168.1.111
#export ROS_IP=192.168.1.111

######  rgbd_slam
#source /opt/ros/indigo/setup.bash
#source /home/yhzhao/rgbdslam_ws/devel/setup.bash
#source /home/yhzhao/rgbdslam_ws/devel/setup.bash

#export ROS_PACKAGE_PATH=~/rgbdslam_ws/src:$ROS_PA#CKAGE_PATH
#export ROS_WORKSPACE=~/rgbdslam_ws/src

######  rtab_ws
#source /opt/ros/indigo/setup.bash
#source /home/yhzhao/slam_open_sources/ros_ws/devel/setup.bash

#export ROS_PACKAGE_PATH=/home/yhzhao/slam_open_sources/ros_ws/src:$ROS_PACKAGE_PATH
#export ROS_WORKSPACE=/home/yhzhao/slam_open_sources/ros_ws/src

 

#source ~/rosbuild_ws/setup.bash



在bashrc中进行上面设置的原因,主要是在每次启动终端时,加载ros的配置变量,不然基本的ros指令就无法识别,也找不到对应包..

source 可以认为它是读取每一个环境变量设置. 支持覆盖重载..

       ros一般在apt-get 安装下是装在/opt/ros/indigo/  下面的, 可以认为它只安装了头文件和基本库的  release版本, 如果我们需要下载对应的源码, 最好在home文件夹下,创建

自己的工作空间, 再编译. 按照source 的次序支持包覆盖.

ROS_PACKAGE_PATH     ros包查找的路径.

ROS_WORKSPACE   工作路径  .  roscd 对应的位置.

 

参考:ROS编译:catkin简析

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值