Ask Your Question
0

Fail building rclpy from source

asked 2021-01-06 02:44:48 -0500

Hi everyone.

I faced a problem that fail building rclpy from source.

I followed a official guide in this repository, but falied building during colcon build with a log below.

Starting >>> rclpy   
--- stderr: rclpy                               
In file included from /home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c:59:
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c:23:3: error: unknown type name ‘rmw_message_lost_status_t’
   23 |   rmw_message_lost_status_t message_lost;
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c: In function ‘_message_lost_to_py_object’:
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c:171:3: error: unknown type name ‘rmw_message_lost_status_t’; did you mean ‘rmw_liveliness_lost_status_t’?
  171 |   rmw_message_lost_status_t * actual_data = &data->message_lost;
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
      |   rmw_liveliness_lost_status_t
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c:174:16: error: request for member ‘total_count’ in something not a structure or union
  174 |     actual_data->total_count,
      |                ^~
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c:175:16: error: request for member ‘total_count_change’ in something not a structure or union
  175 |     actual_data->total_count_change);
      |                ^~
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c: In function ‘_get_qos_event_data_filler_function_for’:
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c:254:12: error: ‘RCL_SUBSCRIPTION_MESSAGE_LOST’ undeclared (first use in this function)
  254 |       case RCL_SUBSCRIPTION_MESSAGE_LOST:
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c:254:12: note: each undeclared identifier is reported only once for each function it appears in
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c: In function ‘rclpy_init’:
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c:625:13: warning: implicit declaration of function ‘rcl_init_options_set_domain_id’; did you mean ‘rcl_init_options_get_allocator’? [-Wimplicit-function-declaration]
  625 |       ret = rcl_init_options_set_domain_id(&init_options, (size_t)domain_id);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |             rcl_init_options_get_allocator
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c: In function ‘rclpy_resolve_name’:
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c:1730:19: warning: implicit declaration of function ‘rcl_node_resolve_name’; did you mean ‘rclpy_resolve_name’? [-Wimplicit-function-declaration]
 1730 |   rcl_ret_t ret = rcl_node_resolve_name(
      |                   ^~~~~~~~~~~~~~~~~~~~~
      |                   rclpy_resolve_name
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c: In function ‘rclpy_context_get_domain_id’:
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c:5634:19: warning: implicit declaration of function ‘rcl_context_get_domain_id’; did you mean ‘rclpy_context_get_domain_id’? [-Wimplicit-function-declaration]
 5634 |   rcl_ret_t ret = rcl_context_get_domain_id(context, &domain_id);
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                   rclpy_context_get_domain_id
make[2]: *** [CMakeFiles/rclpy.dir/build.make:63: CMakeFiles/rclpy.dir/src/rclpy/_rclpy.c.o] エラー 1
make[2]: *** 未完了のジョブを待っています....
make[1]: *** [CMakeFiles/Makefile2:140: CMakeFiles/rclpy.dir/all] エラー 2
make[1]: *** 未完了のジョブを待っています....
make: *** [Makefile:141: all] エラー 2
---
Failed   <<< rclpy [23.5s, exited with code 2]

Summary: 0 packages finished [23.6s]
  1 package failed: rclpy
  1 package had stderr output: rclpy

What is the cause?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2021-01-06 10:56:08 -0500

sloretz gravatar image

Mostly likely you're building the master branch against a released version of ROS. When building from master, you must build all packages from their latest development branch too. See this page for a guide:

https://index.ros.org/doc/ros2/Instal...

If you would like to build rclpy against the version of ROS you're using, checkout the appropriate branch. The rclpy repo has branches called dashing, eloquent, and foxy.

example for ROS Dashing:

cd rclpy
git checkout dashing
edit flag offensive delete link more

Comments

Thanks! Probably, a problem in my case is this.

ksato-dev gravatar image ksato-dev  ( 2021-01-07 07:05:15 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-01-06 02:44:48 -0500

Seen: 67 times

Last updated: Jan 06