Difference between revisions of "ROS2"
From ElphelWiki
(→Work) |
|||
Line 20: | Line 20: | ||
===Work=== | ===Work=== | ||
− | * | + | ====Test Talker and Listener==== |
− | * ros2 run demo_nodes_cpp listener | + | * '''AMENT_PREFIX_PATH?''' |
− | + | root@elphel393:~# AMENT_PREFIX_PATH=/usr ros2 run demo_nodes_cpp talker | |
+ | * Term2: | ||
+ | root@elphel393:~# AMENT_PREFIX_PATH=/usr ros2 run demo_nodes_cpp listener | ||
+ | |||
+ | Note: If AMENT_PREFIX_PATH is not set then: | ||
+ | <font size='1'>Traceback (most recent call last): | ||
+ | File "/usr/bin/ros2", line 11, in <module> | ||
+ | load_entry_point('ros2cli==0.4.0', 'console_scripts', 'ros2')() | ||
+ | File "/usr/lib/python3.5/site-packages/ros2cli/cli.py", line 64, in main | ||
+ | rc = extension.main(parser=parser, args=args) | ||
+ | File "/usr/lib/python3.5/site-packages/ros2run/command/run.py", line 59, in main | ||
+ | executable_name=args.executable_name) | ||
+ | File "/usr/lib/python3.5/site-packages/ros2run/api/__init__.py", line 30, in get_executable_path | ||
+ | paths = get_executable_paths(package_name=package_name) | ||
+ | File "/usr/lib/python3.5/site-packages/ros2pkg/api/__init__.py", line 41, in get_executable_paths | ||
+ | prefix_path = get_prefix_path(package_name) | ||
+ | File "/usr/lib/python3.5/site-packages/ros2pkg/api/__init__.py", line 34, in get_prefix_path | ||
+ | prefix_path = get_package_prefix(package_name) | ||
+ | File "/usr/lib/python3.5/site-packages/ament_index_python/packages.py", line 49, in get_package_prefix | ||
+ | content, package_prefix = get_resource('packages', package_name) | ||
+ | File "/usr/lib/python3.5/site-packages/ament_index_python/resources.py", line 37, in get_resource | ||
+ | for path in get_search_paths(): | ||
+ | File "/usr/lib/python3.5/site-packages/ament_index_python/search_paths.py", line 30, in get_search_paths | ||
+ | "Environment variable '{}' is not set or empty".format(AMENT_PREFIX_PATH_ENV_VAR)) | ||
+ | <font color='red'>'''OSError: Environment variable 'AMENT_PREFIX_PATH' is not set or empty'''</font></font> |
Revision as of 12:58, 4 December 2018
Contents
GitHub
https://github.com/bmwcarit/meta-ros.git
ROS1
Build
- Won't build
Work
- Won't work
ROS2
Build
- Add path to bblayers.conf
- Add to "IMAGE_INSTALL_append" of core-image-elphel393.bb:
ros2-demo-nodes-cpp \ ros2topic \ ros2msg \ ros2run \
Work
Test Talker and Listener
- AMENT_PREFIX_PATH?
root@elphel393:~# AMENT_PREFIX_PATH=/usr ros2 run demo_nodes_cpp talker
- Term2:
root@elphel393:~# AMENT_PREFIX_PATH=/usr ros2 run demo_nodes_cpp listener
Note: If AMENT_PREFIX_PATH is not set then:
Traceback (most recent call last): File "/usr/bin/ros2", line 11, in <module> load_entry_point('ros2cli==0.4.0', 'console_scripts', 'ros2')() File "/usr/lib/python3.5/site-packages/ros2cli/cli.py", line 64, in main rc = extension.main(parser=parser, args=args) File "/usr/lib/python3.5/site-packages/ros2run/command/run.py", line 59, in main executable_name=args.executable_name) File "/usr/lib/python3.5/site-packages/ros2run/api/__init__.py", line 30, in get_executable_path paths = get_executable_paths(package_name=package_name) File "/usr/lib/python3.5/site-packages/ros2pkg/api/__init__.py", line 41, in get_executable_paths prefix_path = get_prefix_path(package_name) File "/usr/lib/python3.5/site-packages/ros2pkg/api/__init__.py", line 34, in get_prefix_path prefix_path = get_package_prefix(package_name) File "/usr/lib/python3.5/site-packages/ament_index_python/packages.py", line 49, in get_package_prefix content, package_prefix = get_resource('packages', package_name) File "/usr/lib/python3.5/site-packages/ament_index_python/resources.py", line 37, in get_resource for path in get_search_paths(): File "/usr/lib/python3.5/site-packages/ament_index_python/search_paths.py", line 30, in get_search_paths "Environment variable '{}' is not set or empty".format(AMENT_PREFIX_PATH_ENV_VAR)) OSError: Environment variable 'AMENT_PREFIX_PATH' is not set or empty