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

Problem with building workspace in ros2

asked 2020-03-26 05:39:05 -0500

AHJL001 gravatar image

updated 2020-03-28 08:47:12 -0500

I was trying to set up a simple client in ROS1 (melodic) and a simple server in ROS2 (eloquent). Following the tutorial https://github.com/osrf/free_fleet/bl.... However I got stuck at the point where I am building my workspace in ROS2 (at colcon build)

cd ~/server_ws
source /opt/ros/eloquent/setup.bash

# build cyclonedds first with the necessary cmake flags
colcon build --packages-select cyclonedds --cmake-args -DBUILD_IDLC=NO

# build the rest of the packages
colcon build

These were the following error messages.

Starting >>> rmf_traffic
--- stderr: rmf_traffic                                                  
CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal)
  CMakeLists.txt:26 (pkg_check_modules)
---
Failed   <<< rmf_traffic    [ Exited with code 1 ]
Aborted  <<< rmf_fleet_msgs                       
Aborted  <<< rmf_door_msgs                        
Aborted  <<< building_map_msgs
Aborted  <<< rmf_lift_msgs                         
Aborted  <<< rmf_workcell_msgs                     
Aborted  <<< rmf_dispenser_msgs                    
Aborted  <<< rmf_traffic_msgs

Please advise.

edit retag flag offensive close merge delete

Comments

Can you clarify what you mean by "stuck"? It looks like the package succeeded to build (I believe the error message can be ignored). Do you have any errors running the code ?

marguedas gravatar image marguedas  ( 2020-03-26 06:39:37 -0500 )edit

@marguedas Perhaps my problem is another issue. The following line which I have to run is colcon build The error messages are as follows:

Starting >>> rmf_traffic
--- stderr: rmf_traffic                                                  
CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal)
  CMakeLists.txt:26 (pkg_check_modules)
---
Failed   <<< rmf_traffic    [ Exited with code 1 ]
Aborted  <<< rmf_fleet_msgs                       
Aborted  <<< rmf_door_msgs                        
Aborted  <<< building_map_msgs
Aborted  <<< rmf_lift_msgs                         
Aborted  <<< rmf_workcell_msgs                     
Aborted  <<< rmf_dispenser_msgs                    
Aborted  <<< rmf_traffic_msgs

Do you have any idea? Thank you for your time

AHJL001 gravatar image AHJL001  ( 2020-03-26 08:25:48 -0500 )edit
1

Yes this looks like an actual error. Can you please edit your original question and title to reflect that this is the problem you are looking for a solution for ?

marguedas gravatar image marguedas  ( 2020-03-26 09:23:38 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-26 09:31:09 -0500

marguedas gravatar image

updated 2020-03-31 02:41:45 -0500

Based on the updated description, rmf_traffic is failing to build due to missing dependencies.

The reason is that the tutorial fails to mention to install the packages dependencies before building.

In order to install the dependencies of the packages in your workspace, it is recommended to use rosdep

rosdep update
rosdep install --from-paths src --ignore-src -y

So in the tutorial you are using it will look like:

cd ~/client_ws
source /opt/ros/melodic/setup.bash

# Tell rosdep to ignore the ROS 2 packages as this is the ROS 1 melodic workspace
touch ~/client_ws/src/free_fleet/free_fleet_examples_ros2/CATKIN_IGNORE
touch ~/client_ws/src/free_fleet/free_fleet_server_ros2/CATKIN_IGNORE

# install dependencies
rosdep update
rosdep install --from-paths src --ignore-src -y --rosdistro melodic

# build cyclonedds first with the necessary cmake flags
catkin build cyclonedds --cmake-args -DBUILD_IDLC=NO

# build the rest of the packages
catkin build

and

cd ~/server_ws
source /opt/ros/eloquent/setup.bash

# install dependencies
rosdep update
rosdep install --from-paths src --ignore-src -y --rosdistro eloquent

# build cyclonedds first with the necessary cmake flags
colcon build --packages-select cyclonedds --cmake-args -DBUILD_IDLC=NO
edit flag offensive delete link more

Comments

Thank you for the looking into the issue. After I entered rosdep install --from-paths src --ignore-src -y into the terminal, the following pops up.

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
free_fleet_examples_ros1: Cannot locate rosdep definition for [map_server]

How can I go about this? Once again, thank you so much for your time.

AHJL001 gravatar image AHJL001  ( 2020-03-28 08:56:21 -0500 )edit

did you properly source /opt/ros/melodic/setup.bash and ran rosdep update before ? The map_server package definitely exist for that distribution:

root@0834a3c5b792:/# rosdep resolve map_server
#apt
ros-melodic-map-server
marguedas gravatar image marguedas  ( 2020-03-29 05:16:36 -0500 )edit

@marguedas Yes, this is the message when trying to use rosdep install --from-paths src --ignore-src -y in the client_ws after sourcing the environment and entering the command rosdep update

computer:~/client_ws$ rosdep install --from-paths src --ignore-src -y
    ERROR: the following packages/stacks could not have their rosdep keys resolved
    to system dependencies:
    free_fleet_examples_ros2: Cannot locate rosdep definition for [rmf_fleet_msgs]
    free_fleet_server_ros2: Cannot locate rosdep definition for [ament_lint_common]

The above mentioned comment regarding the other system dependencies is the error message after using rosdep install --from-paths src --ignore-src -y in the server_ws.

Please advise

AHJL001 gravatar image AHJL001  ( 2020-03-29 20:43:58 -0500 )edit

The only reason I see for this to be happening is if you're mixing ROS distributions in your terminal, and rosdep is looking for the packages for the wrong distribution.

Do you still have the map_server error if you do the following:

Open a new terminal

cd ~/client_ws
source /opt/ros/melodic/setup.bash
rosdep install --from-paths src --ignore-src -y --rosdistro melodic
marguedas gravatar image marguedas  ( 2020-03-30 03:00:40 -0500 )edit

@marguedas

I have solved the map_server error by installing it on the melodic distribution from debian packages. However, the current issue is the one that is mentioned recently.

rosdep install --from-paths src --ignore-src -y
    ERROR: the following packages/stacks could not have their rosdep keys resolved
    to system dependencies:
    free_fleet_examples_ros2: Cannot locate rosdep definition for [rmf_fleet_msgs]
    free_fleet_server_ros2: Cannot locate rosdep definition for [ament_lint_common]

I believe it is saying I am lacking the above packages. Unfortunately, I am unable to locate the missing packages. I have tried sudo apt install ros-eloquent-ament-lint-common which told me that I do have the latest version but rosdep still shows the same error message.

AHJL001 gravatar image AHJL001  ( 2020-03-30 03:46:35 -0500 )edit

Installing it by hand prevents you from finding the source of your rosdep problem...

For ament_lint_common, it's most likely the same issue as above. And the solution is likely the same:

Open a **new** terminal
cd ~/server_ws
source /opt/ros/eloquent/setup.bash
rosdep install --from-paths src --ignore-src -y --rosdistro eloquent

rmf_fleet_msgs should be in your workspace as it's a package provided by rmf_core

marguedas gravatar image marguedas  ( 2020-03-30 04:12:18 -0500 )edit

@marguedas I think I mentioned it wrongly. The cilent_ws which is the workspace to be done in ros-melodic has the error messages

 ERROR: the following packages/stacks could not have their rosdep keys resolved
    to system dependencies:
    free_fleet_examples_ros2: Cannot locate rosdep definition for [rmf_fleet_msgs]
    free_fleet_server_ros2: Cannot locate rosdep definition for [ament_lint_common]

As for the server_ws which is to be done in a ros-eloquent environment shows #All required rosdeps installed successfully now.

AHJL001 gravatar image AHJL001  ( 2020-03-30 04:42:19 -0500 )edit
1

oh I see. It's because client_ws includes both ROS 1 and ROS 2 packages. In that case you'd want to ignore the ROS 2 packages:

touch ~/client_ws/src/free_fleet/free_fleet_examples_ros2/CATKIN_IGNORE
touch ~/client_ws/src/free_fleet/free_fleet_server_ros2/CATKIN_IGNORE

This should solve your issue. Once solved I recommend you to open an issue on the github repository to report the problems you have been facing, this way maintainers can update the instructions for a more straight forward installation.

marguedas gravatar image marguedas  ( 2020-03-30 05:11:21 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2020-03-26 05:39:05 -0500

Seen: 3,246 times

Last updated: Mar 31 '20