Difference between revisions of "ROS2"

From ElphelWiki
Jump to: navigation, search
(ROS2)
(Work)
Line 53: Line 53:
 
     "Environment variable '{}' is not set or empty".format(AMENT_PREFIX_PATH_ENV_VAR))
 
     "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>
 
  <font color='red'>'''OSError: Environment variable 'AMENT_PREFIX_PATH' is not set or empty'''</font></font>
 +
 +
====2. Available packages====
 +
* SSH session:
 +
root@elphel393:~# export AMENT_PREFIX_PATH=/usr
 +
root@elphel393:~# ros2 pkg list
 +
 +
<font size='1'>builtin_interfaces
 +
demo_nodes_cpp
 +
example_interfaces
 +
geometry_msgs
 +
rcl
 +
rcl_interfaces
 +
rclcpp
 +
rclpy
 +
rcutils
 +
rmw
 +
rmw_fastrtps_cpp
 +
rosidl_cmake
 +
rosidl_generator_c
 +
rosidl_generator_cpp
 +
rosidl_parser
 +
rosidl_typesupport_interface
 +
rosidl_typesupport_introspection_c
 +
rosidl_typesupport_introspection_cpp
 +
sensor_msgs
 +
</font>

Revision as of 14:03, 4 December 2018

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 \

Notes:

  • Is this a required minimum?

Work

1. Test Talker and Listener

  • SSH session 1:
root@elphel393:~# export AMENT_PREFIX_PATH=/usr
root@elphel393:~# ros2 run demo_nodes_cpp talker
  • SSH session 2:
root@elphel393:~# export AMENT_PREFIX_PATH=/usr
root@elphel393:~# ros2 run demo_nodes_cpp listener

Notes:

  • 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

2. Available packages

  • SSH session:
root@elphel393:~# export AMENT_PREFIX_PATH=/usr
root@elphel393:~# ros2 pkg list
builtin_interfaces
demo_nodes_cpp
example_interfaces
geometry_msgs
rcl
rcl_interfaces
rclcpp
rclpy
rcutils
rmw
rmw_fastrtps_cpp
rosidl_cmake
rosidl_generator_c
rosidl_generator_cpp
rosidl_parser
rosidl_typesupport_interface
rosidl_typesupport_introspection_c
rosidl_typesupport_introspection_cpp
sensor_msgs