(ros//environmentvariables) Ros environment variables

Source: Internet
Author: User

Http://wiki.ros.org/ROS/EnvironmentVariables

Ros/environmentvariables

In ROS , you can set many environment variables. The most necessary to understand is ros_master_uri,ros_root and ros_package_path, because they are frequently used in systems and files.

Environment variables have multiple roles in ROS :

1 Search for packages (finding packages) :

    First, ros_root and ros_package_path Span style= "font-family: Arial" > make ros in System file (filesystem) packages stacks pythonpath python interpreter to find ros library.

2 affecting a node run time (effecting a Node runtime):

There are several environment variables that affect the operation of the node. Ros_master_uri is an important environment variable to tell the node where the Master (host) is. ros_ip and ros_hostname affect the network address of a node,ros_namespace Allows you to change the namespace. ros_log_dir allows you to set the directory to which log files are written. These can also be overridden by mapped parameters, which take precedence over environment variables.

3 Modifying the build system (Modifying the build system):

Ros_bindeps_path,ros_boost_root ,ros_parallel_jobs and ros_lang_ DISABLE affects where to look for libraries, how to build them, and which to build.

These environment variables will be described in more detail below.

Required ROS Environment Variables

Most systems are set to ros_packge_path,andROS only requires environment variables Ros_root,ros_master_uri and PYTHONPATH. By default They are set by Sourcing/opt/ros/fuerte/setup.bash .

1. Ros_root

Ros_root set The location of the ROS core package installation.

              Export Ros_root=/home/user/ros/ros              export path= $ROS _root/bin: $PATH

2. Ros_master_uri

Ros_master_uri is a required setting to tell the node where to locate MASTER. the master 's xml-rpc URIshould be set. Use localhost with extreme caution, because remote boot nodes can lead to unexpected results.

                 Export ros_master_uri=http://mia:11311/

3. PYTHONPATH

ROS need to be PYTHONPATH updated, although you may not need Python Programming! Many ROS -based tools rely on Pythonand need to be connected to the roslib package to bootstrapping.

              Export pythonpath= $PYTHONPATH: $ROS _root/core/roslib/src

Other PATH Environment Variables

1. ros_package_path

Ros_package_path is an optional, but very common environment variable that allows you to add more ROS packages from the source to your current environment. Ros_package_path can consist of one or more paths, between paths by standard operating system path spacers ( in Unix class Systems , separated by ': ') . These orderly paths tell the Ros system where to search for more Ros packages. If multiple packages have the same name,ROS will first select the one that appears in the ros_package_path .

                Export Ros_package_path=/home/user/ros/ros-pkg:/another/path

Note that each entry in the Ros_package_path is repeatedly searched - The package mentioned in the path will be found.

After introducing Catkin ,ros_package_path is obsolete and is only used to keep backwards compatibility with rosbuild packages.

System Data Environment variables

1. Ros_home

By default,ROS writes data to ~/.ros. You can Change this position by setting the Ros_home. You can also Change the location of a directory in ~/.ros ( For example,ros_test_results_dir,ros_log_dir) .

2. Ros_log_dir

By default,ROS writes internal log files to ros_home/log. If this location is not writable for ROS, or if you want the log file to be written elsewhere, set ros_log_dir to another path.

3. Ros_test_results_dir

The directory to which the test results are to be written.

Other Bash Environment Variables

1. Ros_locations

Ros_locations is an optional environment variable that provides a key name for a useful location. It is a delimited list of key-location pairs. Each key-location pair is delimited by one = . For example :

              Export ros_locations= "Rospkg=/path/to/rospkg:stairpkg=/path/to/stairpkg"

These keys can then be used with some tools, such as roscd.

2. Ros_workspace

Ros_workspace introduced by tool Rosinstall/rosws , when creating a WORKSPACE , generated by these tools setup.sh settings. It points to the workspace folder, which is used as the default target for the command by using the rosws command.

When called without arguments, the roscd tool in Fuerte also switches to this variable. Previously, it changed ros_root by default .

Node environment variables

1. Ros_ip/ros_hostname

Ros_ipand theRos_hostnameis an optional environment variable that is used to set theROSthe public network address of the node or tool. These two options are mutually exclusive, and if both are set first useRos_hostname. If you specify aIPaddress, usingros_ipIf a host name is established(a host name), usingRos_hostname. When aROSmember ReportsURIGiveMasteror other members, this value will be used. This setting is used only on a single computer with multiple addresses and requires mandatoryROSto a particular situation.

In addition to ' localhost ' ( Local host ), ROS members bind to all available network interfaces, and he does not affect the actual binding address. If this value is set to the local host,theROS members are bound only to the loopback interface. This will prevent remote members from communicating with local members.

2. Ros_namespace

Ros_namespace allows you to push a node to a namespace. All names in the node are resolved relative to this value, including the mapping name.

3. Rosconsole_config_fie

This is a roscpp specified environment variable. rosconsole lets you define the configuration file used in log4cxx , through the environment variable rosconsole_config_file defined. Any definitions in this configuration file will overwrite the default configuration file.

4. Console output Formatting control console export format

Rosconsole allows you to specify how the environment variable rosconsole_format in the console output. The default is equivalent to:

          Export rosconsole_format= ' [${severity}] [${time}]: ${message} '

5. Ros_python_log_config_file

Specific Rospy, Rosmaster, Roslaunch, and Rostest. for these tools, you can specify that you use your own Python Logging configuration file instead of the default profile, which is saved in the $ROS _root/config/python_logging.conf.

Building System Environment variables

To get a better understanding of these environment variables, see the ROS Build System section.

1. Ros_boost_root

Ros_boost_root is an optional environment variable that allows you to cover where to look for incentives. If ros_boost_root is not set, Ros_bindeps_path is used by default .

2. Ros_parallel_jobs

The value of this variable, if set, is passed to make when the package is built. The goal is to fully use multiprocessor machines. For example, if you have 8 processors / cores, you want to run as many parallel tasks as possible, as long as the system load is less than 8, by limiting the task to 8 , you can block overshoot at startup:

             Export ros_parallel_jobs= '-j8-l8 '

Alternatively, you can use the -j identity with a parameter to run up to 8 tasks in parallel, with system load Independent:

           Export Ros_parallel_jobs=-j8

It is strongly recommended to use the- l flag to set restrictions on parallel systems. Too much parallelism in a large build can run out of system memory.

How much system load you can accept depends on how many cores you have.

3. ros_lang_disable

The message generator/client library package name should disable a colon-delimited list. Message-generation won't happen for languages in the This list.

Packages built with Catkin need to list the names of message generators that should be ignored, such as:

           Export Ros_lang_disable=genlisp

Packages built with rosbuild need to list the names of message generators and client libraries that should be ignored, such as:

            Export Ros_lang_disable=genlisp:roslisp

When ignoring the rosbuild and CMake Configuration steps of the message generator , a warning is displayed that the client library ( For example, ROSLISP) is not a known message generator. This warning can be safely ignored.

Note that before disabling the language, you must first determine that the code you are using is not bound to the language.

4. Ros_os_override

Format:"os_name:os_version_string", which will force the detection of Ubuntu Lucid:

              Export ros_os_override=ubuntu:10.04

If defined, this overrides the automatic detection of the system. When debugging ROSDEP dependencies on a foreign platform, it is useful when the platform is similar and may need to be enforced or automatically detected as failed.



Email: [Email protected]


(ros//environmentvariables) Ros environment variables

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.