ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

package not fount when sourcing workspace

asked 2022-11-04 04:53:07 -0600

muttidrhummer gravatar image

Hi all, I'm on Ros2 rolling, Ubuntu 22.04.

I'm building a workspace consisting of 2 packages, one called omron_ros2_msgs and the other one omron_ros2_agv. I start with a clean workspace, then source the /opt setup.bash file, build the workspace with colcon build, and source the install/setup.bash file of the workspace. Unfortunately, after building and sourcing the workspace, ros2 cli cannot see either of the two workspaces. If i source the specific local setup file of the omron_ros2_agv package ("install/omron_ros2_agv/share/omron_ros2_agv/local_setup.bash"), then it works, and i can see the package in the ros2 pkg list. Am i doing something wrong? The cmake and package files of the omron_ros2_agv package are the following :

cmake_minimum_required(VERSION 3.8)
project(omron_ros2_agv)

add_compile_options(-std=c++17)
add_compile_options(-Wall)
add_compile_options(-Wextra)
add_compile_options(-Wno-unused-parameter)

set(CMAKE_BUILD_TYPE Release)

find_package(ament_cmake REQUIRED)
find_package(angles REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(omron_ros2_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(nav_msgs REQUIRED)

find_package(Boost REQUIRED COMPONENTS thread)


add_executable(omron_ros2_agv_node src/ros2_omron_agv_node.cpp)

target_include_directories(omron_ros2_agv_node PUBLIC
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  $<INSTALL_INTERFACE:include>)

target_compile_features(omron_ros2_agv_node PUBLIC c_std_99 cxx_std_17)  # Require C99 and C++17


target_link_libraries(omron_ros2_agv_node
  Aria
  ArNetworking
)

ament_target_dependencies(omron_ros2_agv_node 
                            ${${PROJECT_NAME}_EXPORTED_TARGETS}
                            rclcpp 
                            tf2_ros 
                            sensor_msgs 
                            omron_ros2_msgs
                            geometry_msgs 
                            angles 
                            nav_msgs
                            tf2_geometry_msgs)





install(
  TARGETS omron_ros2_agv_node
  DESTINATION lib/${PROJECT_NAME}
)

ament_export_dependencies(
  rclcpp
  rclcpp_lifecycle
  ${${PROJECT_NAME}_EXPORTED_TARGETS}
)

ament_package()

package.xml :

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>omron_ros2_agv</name>
  <version>0.1.0</version>
  <description>The omron_driver package</description>

  <maintainer email="stiima@todo.todo">stiima</maintainer>

  <license>BSD-3-Clause</license>
  <author>Stiima</author>


  <buildtool_depend>ament_cmake</buildtool_depend>

  <build_depend>omron_ros2_msgs</build_depend>

  <depend>angles</depend>
  <depend>actionlib</depend>
  <depend>actionlib_msgs</depend>
  <depend>move_base_msgs</depend>
  <depend>nav_msgs</depend>
  <depend>roscpp</depend>
  <depend>sensor_msgs</depend>
  <depend>std_msgs</depend>
  <depend>std_srvs</depend>
  <depend>tf2_ros</depend>

  <!-- The export tag contains other, unspecified, tags -->
  <export>
    <!-- Other tools can request additional information be placed here -->

  </export>

</package>

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-11-04 05:06:33 -0600

muttidrhummer gravatar image

ok, i solved. I forgot to put the

<build_type>ament_cmake</build_type>

line in <export> tag of the package.xlm

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-11-04 04:53:07 -0600

Seen: 153 times

Last updated: Nov 04 '22