osrf / ros2_test_cases

Tracking of tests to be performed on a ROS 2 release
16 stars 4 forks source link

Local workspace overlay #1496

Closed marcoag closed 6 months ago

marcoag commented 6 months ago

Build a package in a local workspace which depends on packages supplied for the platform.

Run the tests for the package - all of them should pass.

For source platforms, this means building the candidate package in a separate workspace from the one used in the installation instructions.

TODO: Create a "dummy" package that ensures that we can target other packages using CMake, link against them, and run executables (tests) that are linked against libraries in the main workspace.

Configuration

Process

Local workspace overlay works

knmcguire commented 6 months ago

Currently working on this with a raspberry pi 5, Ubuntu Noble and binary install of ROS with cyclonedds removed from the skip-tags

knmcguire commented 6 months ago

I used the turtlesim package from this tutorial which has several dependencies:

find_package(ament_cmake REQUIRED)
find_package(ament_index_cpp REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Widgets)
find_package(rcl_interfaces REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)
find_package(std_srvs REQUIRED)

The build went like this:

$ colcon build
[0.432s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/opt/ros/jazzy' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.432s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/opt/ros/jazzy/opt/gz_math_vendor' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.432s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/opt/ros/jazzy/opt/gz_utils_vendor' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.432s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/opt/ros/jazzy/opt/gz_cmake_vendor' in the environment variable CMAKE_PREFIX_PATH doesn't exist
Starting >>> turtlesim
[Processing: turtlesim]                             
[Processing: turtlesim]                                     
Finished <<< turtlesim [1min 27s]                              

Summary: 1 package finished [1min 27s]

And I ran the sim with a teleop Terminal 1:

$ . ~/ros2_jazzy/ros2-linux/setup.bash
$ export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
$ ros2 run turtlesim turtlesim_node
QSocketNotifier: Can only be used with threads started with QThread
[INFO] [1714738142.413866995] [turtlesim]: Starting turtlesim with node name /turtlesim
[INFO] [1714738142.424644639] [turtlesim]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445], theta=[0.000000]
[WARN] [1714738195.145752275] [turtlesim]: Rotation goal received before a previous goal finished. Aborting previous goal

Terminal 2:

$ . ~/ros2_jazzy/ros2-linux/setup.bash
$ export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
$ ros2 run turtlesim turtle_teleop_key
Reading from keyboard
---------------------------
Use arrow keys to move the turtle.
Use G|B|V|C|D|E|R|T keys to rotate to absolute orientations. 'F' to cancel a rotation.
'Q' to quit.

turtle sim runs and can be controlled as expected with no errors

Seems to work!

Some additional things that might need looking into:

When I use rosdep to install dependencies I got a warning:


$ rosdep install -i --from-path src --rosdistro jazzy -y
WARNING: given --rosdistro jazzy but ROS_DISTRO is "rolling". Ignoring environment.
clalancette commented 6 months ago

WARNING: given --rosdistro jazzy but ROS_DISTRO is "rolling". Ignoring environment.

Ah, yeah. This is actually a mistake in the documentation. https://docs.ros.org/en/jazzy/Installation/Alternatives/Ubuntu-Install-Binary.html#install-ros-2 should actually say to download from the pre-release section of https://github.com/ros2/ros2/releases . I'll update that.

clalancette commented 6 months ago

All right, here is the PR: https://github.com/ros2/ros2_documentation/pull/4356 . Once that is reviewed, I'll merge it. I'm going to close this out, thanks for testing!