Git Product home page Git Product logo

examples's Introduction

About

The Robot Operating System (ROS) is a set of software libraries and tools that help you build robot applications. From drivers to state-of-the-art algorithms, and with powerful developer tools, ROS has what you need for your next robotics project. And it's all open source. Full project details on ROS.org

Getting Started

Looking to get started with ROS? Our installation guide is here. Once you've installed ROS start by learning some basic concepts and take a look at our beginner tutorials.

Join the ROS Community

Community Resources

Developer Resources

Project Resources

ROS is made possible through the generous support of open source contributors and the non-profit Open Source Robotics Foundation (OSRF). Tax deductible donations to the OSRF can be made here.

examples's People

Contributors

adityapande-1995 avatar ahcorde avatar audrow avatar clalancette avatar codebot avatar dhood avatar dirk-thomas avatar esteve avatar fujitatomoya avatar gerkey avatar hidmic avatar ivanpauno avatar jacobperron avatar jacquelinekay avatar joshua-qnx avatar karsten1987 avatar marcoag avatar maryab-osr avatar mergify[bot] avatar mikaelarguedas avatar mjcarroll avatar nuclearsandwich avatar paudrow avatar ralph-lange avatar sloretz avatar tfoote avatar vmayoral avatar wjwwood avatar yadunund avatar youtalk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

examples's Issues

subscriber_not_composable always throws an error after Ctrl-C

Bug report

Required Info:

Steps to reproduce issue

$ ros2 run examples_rclcpp_minimal_subscriber subscriber_not_composable

Wait a few seconds, then press Ctrl-C gives:

^Csignal_handler(2)
[ERROR] [rclcpp]: Error in destruction of rcl subscription handle: the Node Handle was destructed too early. You will leak memory
[ERROR] [rclcpp]: Error in destruction of rcl subscription handle: the Node Handle was destructed too early. You will leak memory

Expected behavior

Program quits without error.

Actual behavior

Program quits with: [ERROR] [rclcpp]: Error in destruction of rcl subscription handle: the Node Handle was destructed too early. You will leak memory

Additional information

This bug may be in the underlying rclcpp or rcl layers, but since I wasn't sure, I started here.

Error compiling ROS2 under windows.

Hey,

I'm absolutely new to ROS/ROS2 and I'm trying to compile ROS2 under windows. I did all the necessary installations described in "ROS 2.0 setup on Windows". However when I run:
python src\ament\ament_tools\scripts\ament.py build
I receive the following error message:

image

Please help!

ROS 2 IDL tutorial

Context:
ROS 2 interface definition has more features than the ROS 1 one. A tutorial showing all the possibilities of this new interface doesn’t exist yet.

Task:

  • Create an ament package containing
    • msg files covering all the IDL features
      • Add comment next to each field explaining the functionality
    • Source code (C++ and Python) showing how to set and get values for all these message fields
  • Create a Tutorial on the ROS 2 wiki walking the users through the IDL features in ROS 2, using the sample msg files and the associated code

Pointers:
The message files used for testing here and here can be used as a starter and extended accordingly

Refactor example and message packages

We should split up the examples to be rclc or rclcpp specific.

AC:

  • Split userland into rclc_examples and rclcpp_examples
  • Refactor simple_msgs
    • Have a meeting to decide on the types here (perhaps get rid of Int32 for example)
    • Make a common_msgs repository and move messages out of this examples repository.

Client shutdown causes OpenSplice errors on server

When testing the binary package for alpha5 on Windows (10), I found that the add_two_ints_server would start printing a stream of errors like the one below after a client connected and (successfully) called the service.

========================================================================================
Report      : ERROR
Date        : Tue Apr 05 14:31:01 Pacific Daylight Time 2016
Description : UDP recvmsg sock 1816: ret -1 errno 10054

Node        : DESKTOP-LM8SBG1
Process     : add_two_ints_server.exe <4532>
Thread      : recv 3364
Internals   : V6.4.140407OSS/3b83e82/3b83e82/ddsi2/ddsi_socket.c/45/0/1459891861.893614141
========================================================================================

how to stop the timer in python for ros2?

if code my program in code style like publisher_member_function.py, and then I want to publish msg 100 times, and after that end the publisher, how to stop the timer, and exit the program ?

Client

I noticed some flakiness, when reworking the code the ros2param example with multiple parameters. It might not be flaky with one argument as it is written.

Setting the parameters is unreliable with multiple parameters, because the parsing uses errno, which could be flagged by anything. The lines in question are https://github.com/ros2/examples/blob/master/rclcpp_examples/src/parameters/ros2param.cpp#L68 and https://github.com/ros2/examples/blob/master/rclcpp_examples/src/parameters/ros2param.cpp#L73. On Ubuntu with OpenSplice I see errno 110. Connection ETIMEDOUT, which may be related to DDS communication. The parsing should not rely on errno.

Examples compilation errors (related to opensplice) when using VS2015 final release.

We are getting a new error, seems like it was not present on VS2015 RC (14.0.22816.0) nor other compilers, when compiling the examples with the final (both Express and Professional) VS2015.

The error in jenkins:

c:\jenkins\workspace\ros2_batch_ci_windows\workspace\build\example_interfaces\rosidl_typesupport_opensplice_cpp\example_interfaces\srv\dds_opensplice\AddTwoInts_Request_Dcps_impl.h(32): 
error C2248: 'DDS::TypeSupportFactory::TypeSupportFactory': cannot access private member declared in class 'DDS::TypeSupportFactory' [C:\Jenkins\workspace\ros2_batch_ci_windows\workspace\build\example_interfaces

Looks like a typical error of accessing to a default constructor under insufficient permission.

Probably the high level is placed in our examples code is being generated from the examples interfaces IDL code which generates the Sample_AddTwoInts_Response_Dcps_impl.h (this file appears explicitly in the error message) containing:

class ROSIDL_TYPESUPPORT_OPENSPLICE_CPP_PUBLIC_example_interfaces Sample_AddTwoInts_Response_TypeSupportFactory : public ::DDS::TypeSupportFactory_impl
            {
            public:
                Sample_AddTwoInts_Response_TypeSupportFactory() {}
                virtual ~Sample_AddTwoInts_Response_TypeSupportFactory() {}
            private:
                ::DDS::DataWriter_ptr
                create_datawriter (gapi_dataWriter handle);

                ::DDS::DataReader_ptr
                create_datareader (gapi_dataReader handle);

                ::DDS::DataReaderView_ptr
                create_view (gapi_dataReaderView handle);
}; <-- line 32

This class inherited DDS::TypeSupportFactory_impl class. All the code seems sane to me here. The error does not point to this clase but the base class, DDS::TypeSupportFactory which defined the default constructor to protected.

I could imaging two source of errors, if my approaching is right: a compiler bug that got introduced in the last changes of VS 2015 final release or not a bug, but a feature, in the sense of stricter rule for visibility permissions on class inheritance that requires fixes in the code (I can not see which ones).

rclpy_examples: cannot import module when using --symlink-install

When building from source and testing the Python talker listener's I get:

% ./install/bin/listener_py
Traceback (most recent call last):
  File "./install/bin/listener_py", line 9, in <module>
    load_entry_point('rclpy-examples', 'console_scripts', 'listener_py')()
  File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 568, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2720, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2380, in load
    return self.resolve()
  File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2386, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ImportError: No module named 'listener_py'

Rerunning the build with the command src/ament/ament_tools/scripts/ament.py build --build-tests --only rclpy_examples (without --symlink-install) makes it so the examples in bin work.

I'm looking into a fix but it seems to be related to develop mode of setuptools being used in combination with py_modules and a custom egg info directory (out of source). A workaround might be to use a Python package in the examples package for now.

ROS2 installation on MacOS

Hi @wjwwood,
This is Anita from Erle Robotics and I´m new with ROS. I´m trying to install ROS2 on Mac following these instructions: https://github.com/ros2/examples/wiki
However, I´m stuck in the very first command:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
sh: lsb_release: command not found

I´ve searched it on the net but I have not been able to find a solution, I do not know how to translate those steps in Mac. Could you guide me in the installation of ROS2 on Mac?
Thanks for all,

Anita

"client_main" and "service_main" failed (hang up) 3/10 times

Bug report

Required Info:

  • Operating System:
    Ubuntu 18.04
  • Installation type:
    Binaries
  • Version or commit hash:
    ROS2 Crystal Release
  • DDS implementation:
    the default one
  • Client library (if applicable):
    rclcpp

Steps to reproduce issue

from terminal #1
ros2 run examples_rclcpp_minimal_service service_main
from terminal #2, repeat
ros2 run examples_rclcpp_minimal_client client_main

Expected behavior

On each running of the client_main, the terminal #2 supposed to print
[INFO] [minimal_client]: result of 41 + 1 = 42

Actual behavior

Out of 10 running, only 7 success.
3 times client_main hang up, no output from client_main, nor output from service_main.
Once hand up, only ctrl+c can exit the client_main.

Additional information

$ ros2 run examples_rclcpp_minimal_client client_main
[INFO] [minimal_client]: result of 41 + 1 = 42
$ ros2 run examples_rclcpp_minimal_client client_main
^C[INFO] [rclcpp]: signal_handler(signal_value=2)
[ERROR] [minimal_client]: service call failed :(
$ ros2 run examples_rclcpp_minimal_client client_main
[INFO] [minimal_client]: result of 41 + 1 = 42
$ ros2 run examples_rclcpp_minimal_client client_main
[INFO] [minimal_client]: result of 41 + 1 = 42
$ ros2 run examples_rclcpp_minimal_client client_main
[INFO] [minimal_client]: result of 41 + 1 = 42
$ ros2 run examples_rclcpp_minimal_client client_main
[INFO] [minimal_client]: result of 41 + 1 = 42
$ ros2 run examples_rclcpp_minimal_client client_main
^C[INFO] [rclcpp]: signal_handler(signal_value=2)
[ERROR] [minimal_client]: service call failed :(
$ ros2 run examples_rclcpp_minimal_client client_main
[INFO] [minimal_client]: result of 41 + 1 = 42
$ ros2 run examples_rclcpp_minimal_client client_main
^C[INFO] [rclcpp]: signal_handler(signal_value=2)
[ERROR] [minimal_client]: service call failed :(
$ ros2 run examples_rclcpp_minimal_client client_main
[INFO] [minimal_client]: result of 41 + 1 = 42

class_loader/register_macro.hpp error

Bug report

Required Info:

  • Operating System:
    • Ubuntu 16.04
  • Installation type:
    • binaries or from source
  • Version or commit hash:
    • ardent
  • DDS implementation:
    • Fast-RTPS
  • Client library (if applicable):
    • rclcpp

Steps to reproduce the issue

I have installed ROS2 ardent from binaries and I tried to ament build the examples.
The build was always failed to return the following error:

/home/angelos/ros2_overlay_ws/src/examples/rclcpp/minimal_composition/src/publisher_node.cpp:39:43: fatal error: class_loader/register_macro.hpp: No such file or directory
compilation terminated.
CMakeFiles/composition_nodes.dir/build.make:62: recipe for target 'CMakeFiles/composition_nodes.dir/src/publisher_node.cpp.o' failed
make[2]: *** [CMakeFiles/composition_nodes.dir/src/publisher_node.cpp.o] Error 1
/home/angelos/ros2_overlay_ws/src/examples/rclcpp/minimal_composition/src/subscriber_node.cpp:29:43: fatal error: class_loader/register_macro.hpp: No such file or directory

By searching deeper in my ROS2 installation I discovered that the correct header files are:
class_loader/class_loader_register_macro.h

Then everything works as expected.

compiler warning operator delete

Using g++ 5.3 on Xenial the compiler warns about the following:

.../src/ros2/examples/rclcpp_examples/src/topics/allocator_example.cpp:141:6: warning: ‘void operator delete(void*, size_t)’ is a usual (non-placement) deallocation function in C++14 (or with -fsized-deallocation) [-Wc++14-compat]
 void operator delete(void * ptr, size_t) noexcept
      ^
.../src/ros2/examples/rclcpp_examples/src/topics/allocator_example.cpp:141:6: warning: ‘void operator delete(void*, size_t)’ is a usual (non-placement) deallocation function in C++14 (or with -fsized-deallocation) [-Wc++14-compat]
 void operator delete(void * ptr, size_t) noexcept
      ^
.../src/ros2/examples/rclcpp_examples/src/topics/allocator_example.cpp:141:6: warning: ‘void operator delete(void*, size_t)’ is a usual (non-placement) deallocation function in C++14 (or with -fsized-deallocation) [-Wc++14-compat]
 void operator delete(void * ptr, size_t) noexcept
      ^
.../src/ros2/examples/rclcpp_examples/src/topics/allocator_example.cpp:141:6: warning: ‘void operator delete(void*, size_t)’ is a usual (non-placement) deallocation function in C++14 (or with -fsized-deallocation) [-Wc++14-compat]
 void operator delete(void * ptr, size_t) noexcept
      ^

No rule to make target '/usr/lib/libPocoFoundationd.so'

Bug report

Required Info:

  • Operating System:
    • Ubuntu 16.04
  • Installation type:
    -binaries
  • Version or commit hash:
  • DDS implementation:
    • default

Steps to reproduce issue

Steps I took on a clean install of Ubuntu 16.04

$ sudo apt update && sudo apt install curl
$ curl http://repo.ros2.org/repos.key | sudo apt-key add -
$ sudo sh -c 'echo "deb [arch=amd64,arm64] http://repo.ros2.org/ubuntu/main xenial main" > /etc/apt/sources.list.d/ros2-latest.list'
$ sudo apt update
$ sudo apt install `apt list "ros-ardent-*" 2> /dev/null | grep "/" | awk -F/ '{print $1}' | grep -v -e ros-ardent-ros1-bridge -e ros-ardent-turtlebot2- | tr "\n" " "`
$ sudo apt install python-argcomplete 
$ source /opt/ros/ardent/share/ros2cli/environment/ros2-argcomplete.bash
$ source /opt/ros/ardent/setup.bash
$ mkdir -p ros2_ws/src
$ cd ros2_ws/src
$ git clone https://github.com/ros2/examples.git
$ ament build --cmake-args -DCMAKE_BUILD_TYPE=Debug

Expected behavior

successful build

Actual behavior

Scanning dependencies of target composition_nodes
make[2]: *** No rule to make target '/usr/lib/libPocoFoundationd.so', needed by 'libcomposition_nodes.so'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 11%] Building CXX object CMakeFiles/composition_nodes.dir/src/publisher_node.cpp.o
[ 22%] Building CXX object CMakeFiles/composition_nodes.dir/src/subscriber_node.cpp.o
CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/composition_nodes.dir/all' failed
make[1]: *** [CMakeFiles/composition_nodes.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

<== Command '. /home/athackst/ros2_ws/build/examples_rclcpp_minimal_composition/cmake__build.sh && /usr/bin/make -j4 -l4' failed in '/home/athackst/ros2_ws/build/examples_rclcpp_minimal_composition' with exit code '2'
<== Command '. /home/athackst/ros2_ws/build/examples_rclcpp_minimal_composition/cmake__build.sh && /usr/bin/make -j4 -l4' failed in '/home/athackst/ros2_ws/build/examples_rclcpp_minimal_composition' with exit code '2'

Additional information

I was following the instructions here https://github.com/ros2/ros2/wiki/Ament-Tutorial minus some things that seemed related to a source build of ros2

I skipped the add some sources (https://github.com/ros2/ros2/wiki/Ament-Tutorial#add-some-sources), and went straight to the create an overlay (https://github.com/ros2/ros2/wiki/Ament-Tutorial#create-an-overlay)
If I'm doing a binary install do I still need to add those sources?
What did I miss?

100% action server CPU usage when cancelling a goal from the client

Bug report

Required Info:

  • Operating System:
  • Installation type:
    • Binaries
  • Version or commit hash:
    • Crystal pre-release (updated 14-12-2018; version 0.6.1)
  • DDS implementation:
    • Checked with FastRTPS and connext_cpp
  • Client library (if applicable):
    • rclcpp

Steps to reproduce issue

Start top in a terminal to monitor CPU usage.

Then, from another terminal, run minimal_action_server:

ros2 run examples_rclcpp_minimal_action_server action_server_not_composable

Finally, run minimal_action_client with cancel:

ros2 run examples_rclcpp_minimal_action_client action_client_not_composable_with_cancel

Expected behavior

Action is canceled, everything exits gracefully.

Actual behavior

Action is canceled, but in some cases a CPU thread keeps working at 100% until the server is shut down.

Additional information

This doesn't happen every time the action client is launched, but it's not too hard to reproduce either by launching it a few times. It seems to happen ~50% of the times.
This might be related to ros2/rcl#354.

Can't compile

I followed the instructions provided but I get the following error:

/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp: In function ‘int main(int, char**)’:
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:45: error: ‘AsyncParametersClient’ is not a member of ‘rclcpp::parameter’
auto parameters_client = std::make_sharedrclcpp::parameter::AsyncParametersClient(node);
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:45: note: suggested alternative:
In file included from /home/shadylady/ros2_ws/install/include/rclcpp/rclcpp.hpp:23:0,
from /home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:15:
/home/shadylady/ros2_ws/install/include/rclcpp/parameter_client.hpp:43:7: note: ‘rclcpp::parameter_client::AsyncParametersClient’
class AsyncParametersClient
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:45: error: ‘AsyncParametersClient’ is not a member of ‘rclcpp::parameter’
auto parameters_client = std::make_sharedrclcpp::parameter::AsyncParametersClient(node);
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:45: note: suggested alternative:
In file included from /home/shadylady/ros2_ws/install/include/rclcpp/rclcpp.hpp:23:0,
from /home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:15:
/home/shadylady/ros2_ws/install/include/rclcpp/parameter_client.hpp:43:7: note: ‘rclcpp::parameter_client::AsyncParametersClient’
class AsyncParametersClient
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:91: error: no matching function for call to ‘make_shared(std::shared_ptrrclcpp::node::Node&)’
auto parameters_client = std::make_sharedrclcpp::parameter::AsyncParametersClient(node);
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:91: note: candidate is:
In file included from /usr/include/c++/4.8/memory:82:0,
from /home/shadylady/ros2_ws/install/include/rclcpp/rclcpp.hpp:19,
from /home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:15:
/usr/include/c++/4.8/bits/shared_ptr.h:610:5: note: template<class _Tp, class ... _Args> std::shared_ptr<_Tp1> std::make_shared(_Args&& ...)
make_shared(_Args&&... __args)
^
/usr/include/c++/4.8/bits/shared_ptr.h:610:5: note: template argument deduction/substitution failed:
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:91: error: template argument 1 is invalid
auto parameters_client = std::make_sharedrclcpp::parameter::AsyncParametersClient(node);
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:47:17: error: unable to deduce ‘auto&&’ from ‘values_f2’
for (auto p : values_f2) {
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:53:72: error: expected primary-expression before ‘)’ token
(p.get_valuerclcpp::parameter::ParameterType::PARAMETER_BOOL() ? "true" : "false");
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:57:74: error: expected primary-expression before ‘)’ token
p.get_valuerclcpp::parameter::ParameterType::PARAMETER_INTEGER();
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:61:73: error: expected primary-expression before ‘)’ token
p.get_valuerclcpp::parameter::ParameterType::PARAMETER_DOUBLE();
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:65:73: error: expected primary-expression before ‘)’ token
p.get_valuerclcpp::parameter::ParameterType::PARAMETER_STRING();
^
In file included from /home/shadylady/ros2_ws/install/include/rclcpp/node.hpp:276:0,
from /home/shadylady/ros2_ws/install/include/rclcpp/rclcpp.hpp:21,
from /home/shadylady/ros2_ws/src/ros2/examples/userland/src/prototype_intraprocesses.cpp:19:
/home/shadylady/ros2_ws/install/include/rclcpp/node_impl.hpp: In lambda function:
/home/shadylady/ros2_ws/install/include/rclcpp/node_impl.hpp:318:64: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return std::count(substr.begin(), substr.end(), '.') < depth;
^
In file included from /home/shadylady/ros2_ws/install/include/rclcpp/node.hpp:276:0,
from /home/shadylady/ros2_ws/install/include/rclcpp/rclcpp.hpp:21,
from /home/shadylady/ros2_ws/src/ros2/examples/userland/src/prototype_intraprocesses.cpp:19:
/home/shadylady/ros2_ws/install/include/rclcpp/node_impl.hpp: In lambda function:
/home/shadylady/ros2_ws/install/include/rclcpp/node_impl.hpp:318:64: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return std::count(substr.begin(), substr.end(), '.') < depth;
^
In file included from /home/shadylady/ros2_ws/install/include/rclcpp/node.hpp:276:0,
from /home/shadylady/ros2_ws/install/include/rclcpp/rclcpp.hpp:21,
from /home/shadylady/ros2_ws/src/ros2/examples/userland/src/imu/rosimu/publisher.cpp:22:
/home/shadylady/ros2_ws/install/include/rclcpp/node_impl.hpp: In lambda function:
/home/shadylady/ros2_ws/install/include/rclcpp/node_impl.hpp:318:64: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return std::count(substr.begin(), substr.end(), '.') < depth;
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp: In function ‘int main(int, char**)’:
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:45: error: ‘AsyncParametersClient’ is not a member of ‘rclcpp::parameter’
auto parameters_client = std::make_sharedrclcpp::parameter::AsyncParametersClient(node);
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:45: note: suggested alternative:
In file included from /home/shadylady/ros2_ws/install/include/rclcpp/rclcpp.hpp:23:0,
from /home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:15:
/home/shadylady/ros2_ws/install/include/rclcpp/parameter_client.hpp:43:7: note: ‘rclcpp::parameter_client::AsyncParametersClient’
class AsyncParametersClient
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:45: error: ‘AsyncParametersClient’ is not a member of ‘rclcpp::parameter’
auto parameters_client = std::make_sharedrclcpp::parameter::AsyncParametersClient(node);
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:45: note: suggested alternative:
In file included from /home/shadylady/ros2_ws/install/include/rclcpp/rclcpp.hpp:23:0,
from /home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:15:
/home/shadylady/ros2_ws/install/include/rclcpp/parameter_client.hpp:43:7: note: ‘rclcpp::parameter_client::AsyncParametersClient’
class AsyncParametersClient
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:91: error: no matching function for call to ‘make_shared(std::shared_ptrrclcpp::node::Node&)’
auto parameters_client = std::make_sharedrclcpp::parameter::AsyncParametersClient(node);
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:91: note: candidate is:
In file included from /usr/include/c++/4.8/memory:82:0,
from /home/shadylady/ros2_ws/install/include/rclcpp/rclcpp.hpp:19,
from /home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:15:
/usr/include/c++/4.8/bits/shared_ptr.h:610:5: note: template<class _Tp, class ... _Args> std::shared_ptr<_Tp1> std::make_shared(_Args&& ...)
make_shared(_Args&&... __args)
^
/usr/include/c++/4.8/bits/shared_ptr.h:610:5: note: template argument deduction/substitution failed:
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:23:91: error: template argument 1 is invalid
auto parameters_client = std::make_sharedrclcpp::parameter::AsyncParametersClient(node);
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:47:17: error: unable to deduce ‘auto&&’ from ‘values_f2’
for (auto p : values_f2) {
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:53:72: error: expected primary-expression before ‘)’ token
(p.get_valuerclcpp::parameter::ParameterType::PARAMETER_BOOL() ? "true" : "false");
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:57:74: error: expected primary-expression before ‘)’ token
p.get_valuerclcpp::parameter::ParameterType::PARAMETER_INTEGER();
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:61:73: error: expected primary-expression before ‘)’ token
p.get_valuerclcpp::parameter::ParameterType::PARAMETER_DOUBLE();
^
/home/shadylady/ros2_ws/src/ros2/examples/userland/src/async_parameters.cpp:65:73: error: expected primary-expression before ‘)’ token
p.get_valuerclcpp::parameter::ParameterType::PARAMETER_STRING();
^
make[2]: *** [CMakeFiles/async_parameters__rmw_opensplice_cpp.dir/src/async_parameters.cpp.o] Error 1
make[1]: *** [CMakeFiles/async_parameters__rmw_opensplice_cpp.dir/all] Error 2

Extensions to ros2param

Starting with comments from #116 (feel free to add more here):

  • Add list verb.
  • Test / debug with non-OpenSplice

Create ultra minimalist set of examples

including various coding styles for creating best-practices for standalone executables and components, with minimalist simple CMake code. ( using an Executor vs calling spin() )

install rclc examples

There is currently an AMENT_IGNORE file in the rclc examples due to a name clash with rclcpp i.e. 'talker' and 'listener'.

Does it make sense to introduce a specific suffix for them? Such as __rmw_fastrtps_c ?

python services failing to import typesupport

I am unable to run the rclpy server-client examples/tutorials, they all fail with:
(on OS X and linux, from source and the Dec 13 packaging job).

pub-sub working fine

$ add_two_ints_server_py
Traceback (most recent call last):
  File "/Users/dhood/Downloads/ros2-osx-packaging13dec/bin/add_two_ints_server_py", line 11, in <module>
    load_entry_point('rclpy-tutorials==0.0.0', 'console_scripts', 'add_two_ints_server_py')()
  File "/Users/dhood/Downloads/ros2-osx-packaging13dec/lib/python3.5/site-packages/services/add_two_ints_server_py.py", line 32, in main
    srv = node.create_service(AddTwoInts, 'add_two_ints', add_two_ints_callback)
  File "/Users/dhood/Downloads/ros2-osx-packaging13dec/lib/python3.5/site-packages/rclpy/node.py", line 84, in create_service
    raise NoTypeSupportImportedException
rclpy.exceptions.NoTypeSupportImportedException: no type_support imported

Can not build example using master branch

Bug report

Wanted to try ROS2 for the first time, tried the example but can not build using branch master. If I checkout origin/crystal I can build the examples.

Required Info:

  • Operating System:
    • OS and version: Ubuntu 18.04 (VM using VirtualBox with Windows 10 as Host)
  • Installation type:
    • binaries
  • Version or commit hash:
  • DDS implementation:
    • FastRTPS

Steps to reproduce issue

  1. Fresh install of ROS2 Crystal
  2. Create workspace
  3. clone repo
  4. Build
cd <path_to_ws>
git clone https://github.com/ros2/examples src/examples
colcon build --symlink-install

Expected behavior

georg@georg-ROS2:~/ros_ws$ colcon build --symlink-install
Starting >>> examples_rclcpp_minimal_action_client
Starting >>> examples_rclcpp_minimal_action_server
Finished <<< examples_rclcpp_minimal_action_server [6.46s]                                     
Starting >>> examples_rclcpp_minimal_client
Finished <<< examples_rclcpp_minimal_action_client [10.8s]                                                                               
Starting >>> examples_rclcpp_minimal_composition
Finished <<< examples_rclcpp_minimal_client [5.36s]                                                                                        
Starting >>> examples_rclcpp_minimal_publisher
Finished <<< examples_rclcpp_minimal_publisher [13.2s]                                                                                     
Starting >>> examples_rclcpp_minimal_service
Finished <<< examples_rclcpp_minimal_composition [14.5s]                                          
Starting >>> examples_rclcpp_minimal_subscriber
Finished <<< examples_rclcpp_minimal_service [6.98s]                                                                                      
Starting >>> examples_rclcpp_minimal_timer
Finished <<< examples_rclcpp_minimal_subscriber [12.3s]                                                                                    
Starting >>> examples_rclpy_executors
Finished <<< examples_rclcpp_minimal_timer [6.32s]                                                                       
Starting >>> examples_rclpy_minimal_action_client        
Finished <<< examples_rclpy_executors [1.26s]                                                                      
Starting >>> examples_rclpy_minimal_action_server
Finished <<< examples_rclpy_minimal_action_client [1.00s]                                                                      
Starting >>> examples_rclpy_minimal_client
Finished <<< examples_rclpy_minimal_action_server [1.09s]                                                                
Starting >>> examples_rclpy_minimal_publisher
Finished <<< examples_rclpy_minimal_client [1.05s]                                                                   
Starting >>> examples_rclpy_minimal_service
Finished <<< examples_rclpy_minimal_publisher [1.10s]                                                                 
Starting >>> examples_rclpy_minimal_subscriber
Finished <<< examples_rclpy_minimal_service [1.28s]                                                                    
Finished <<< examples_rclpy_minimal_subscriber [1.18s]             

Summary: 15 packages finished [42.4s]

Actual behavior

georg@georg-ROS2:~/ros_ws$ colcon build --symlink-install
Starting >>> examples_rclcpp_minimal_action_client
Starting >>> examples_rclcpp_minimal_action_server
--- stderr: examples_rclcpp_minimal_action_client                                              
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable_with_cancel.cpp: In function ‘int main(int, char**)’:
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable_with_cancel.cpp:93:47: error: ‘WrappedResult’ is not a member of ‘rclcpp_action::ClientGoalHandle<example_interfaces::action::Fibonacci>’
   rclcpp_action::ClientGoalHandle<Fibonacci>::WrappedResult wrapped_result = result_future.get();
                                               ^~~~~~~~~~~~~
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable_with_cancel.cpp:94:10: error: ‘wrapped_result’ was not declared in this scope
   switch(wrapped_result.code) {
          ^~~~~~~~~~~~~~
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable_with_cancel.cpp:94:10: note: suggested alternative: ‘wait_result’
   switch(wrapped_result.code) {
          ^~~~~~~~~~~~~~
          wait_result
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable_with_cancel.cpp:95:37: error: could not convert ‘SUCCEEDED’ from ‘rclcpp_action::ResultCode’ to ‘<type error>’
     case rclcpp_action::ResultCode::SUCCEEDED:
                                     ^~~~~~~~~
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable_with_cancel.cpp:97:37: error: could not convert ‘ABORTED’ from ‘rclcpp_action::ResultCode’ to ‘<type error>’
     case rclcpp_action::ResultCode::ABORTED:
                                     ^~~~~~~
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable_with_cancel.cpp:100:37: error: could not convert ‘CANCELED’ from ‘rclcpp_action::ResultCode’ to ‘<type error>’
     case rclcpp_action::ResultCode::CANCELED:
                                     ^~~~~~~~
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable.cpp: In function ‘int main(int, char**)’:
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable.cpp:67:47: error: ‘WrappedResult’ is not a member of ‘rclcpp_action::ClientGoalHandle<example_interfaces::action::Fibonacci>’
   rclcpp_action::ClientGoalHandle<Fibonacci>::WrappedResult wrapped_result = result_future.get();
                                               ^~~~~~~~~~~~~
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable.cpp:69:10: error: ‘wrapped_result’ was not declared in this scope
   switch(wrapped_result.code) {
          ^~~~~~~~~~~~~~
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable.cpp:69:10: note: suggested alternative: ‘__codecvt_result’
   switch(wrapped_result.code) {
          ^~~~~~~~~~~~~~
          __codecvt_result
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable.cpp:70:37: error: could not convert ‘SUCCEEDED’ from ‘rclcpp_action::ResultCode’ to ‘<type error>’
     case rclcpp_action::ResultCode::SUCCEEDED:
                                     ^~~~~~~~~
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable.cpp:72:37: error: could not convert ‘ABORTED’ from ‘rclcpp_action::ResultCode’ to ‘<type error>’
     case rclcpp_action::ResultCode::ABORTED:
                                     ^~~~~~~
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable.cpp:75:37: error: could not convert ‘CANCELED’ from ‘rclcpp_action::ResultCode’ to ‘<type error>’
     case rclcpp_action::ResultCode::CANCELED:
                                     ^~~~~~~~
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable.cpp:84:22: error: ‘wrapped_result’ was not declared in this scope
   for (auto number : wrapped_result.result->sequence)
                      ^~~~~~~~~~~~~~
/home/georg/ros_ws/src/examples/rclcpp/minimal_action_client/not_composable.cpp:84:22: note: suggested alternative: ‘__codecvt_result’
   for (auto number : wrapped_result.result->sequence)
                      ^~~~~~~~~~~~~~
                      __codecvt_result
make[2]: *** [CMakeFiles/action_client_not_composable.dir/not_composable.cpp.o] Error 1
make[1]: *** [CMakeFiles/action_client_not_composable.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/action_client_not_composable_with_cancel.dir/not_composable_with_cancel.cpp.o] Error 1
make[1]: *** [CMakeFiles/action_client_not_composable_with_cancel.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< examples_rclcpp_minimal_action_client	[ Exited with code 2 ]
Aborted  <<< examples_rclcpp_minimal_action_server                                         

Summary: 0 packages finished [6.88s]
  1 package failed: examples_rclcpp_minimal_action_client
  1 package aborted: examples_rclcpp_minimal_action_server
  1 package had stderr output: examples_rclcpp_minimal_action_client
  13 packages not processed

Additional information

Expected behavior is taken using commit 62b2132

Example error

I am getting an error when i run the sync_parameters, async_parameters and prototype_intraprocess which are in the examples.

For sync and async errors are:

hiya@hiya-ThinkPad-T530:~/ros2_ws$ source install/setup.bashhiya@hiya-ThinkPad-T530:~/ros2_ws$ ./install/bin/sync_parameters
  rcl_interfaces::type_support::register_type__GetParameters()
  rcl_interfaces::type_support::register_type__GetParameterTypes()
  rcl_interfaces::type_support::register_type__SetParameters()
  rcl_interfaces::type_support::register_type__ListParameters()
  rcl_interfaces::type_support::register_type__DescribeParameters()
terminate called after throwing an instance of 'std::future_error'
  what():  No associated state
Aborted (core dumped)

For intraprocess errors are:

hiya@hiya-ThinkPad-T530:~/ros2_ws$ source install/setup.bash
hiya@hiya-ThinkPad-T530:~/ros2_ws$ ./install/bin/prototype_intraprocess
------ Creating subscriber:
------ Creating publisher:
------ monitor string:Message sent through ROS
------ monitor string:Message sent through ROS
  simple_msgs::type_support::register_type__Intraprocess()
  simple_msgs::type_support::register_type__Intraprocess()
------ Launching subscriber:
------ monitor string:Message sent through ROS
------ monitor string:Message sent through ROS
Segmentation fault (core dumped)
Running it in gdb I got:
“Program received signal SIGSEGV error

May I know the reasons for these errors.

[Suggestion] Disable build for example using opencv

Just a quick remark as I was following the example build from the wiki to create a onbuild Docker hub repo for ros2. The current wiki instruction had to be edited to include apt-get'ing libopencv-dev package for the cam2image example. It'd just be nice to add a note on how to use a flag to disable it to alevate the opencv dependance, as l libopencv is quite large. Just a suggestion

talker_listener test is flaky

Following the same procedure as ros2/system_tests#93:

while true; do nosetests3 -s build/rclcpp_examples/test_talker_listener__rmw_opensplice_cpp.py; done

It eventually stops with this output:

(test_executable_0) pid 28945: ['/home/gerkey/ros2_ws/build/rclcpp_examples/talker__rmw_opensplice_cpp', 'test_executable'] (all > console, InMemoryHandler: test_executable_0)
(test_executable_1) pid 28946: ['/home/gerkey/ros2_ws/build/rclcpp_examples/listener__rmw_opensplice_cpp', 'test_executable'] (all > console, InMemoryHandler: test_executable_1)
[test_executable_0] Publishing: 'Hello World: 1'
[test_executable_0] Publishing: 'Hello World: 2'
(test_executable_0) rc -15

The talker program has now exited, leaving behind the listener, who still wants something. The listener backtrace is:

#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007feb1a6f109b in RTIOsapiSemaphore_take () from /usr/lib/libnddscore.so.5
#2  0x00007feb1a9013c7 in PRESWaitSet_wait () from /usr/lib/libnddscore.so.5
#3  0x00007feb1bf53e6d in DDS_WaitSet_waitI () from /usr/lib/libnddsc.so.5
#4  0x00007feb1ba23ba3 in DDSWaitSet_impl::wait(DDSConditionSeq&, DDS_Duration_t const&) () from /usr/lib/libnddscpp.so.5
#5  0x00007feb1d9e3c28 in int wait<ConnextStaticSubscriberInfo, ConnextStaticServiceInfo, ConnextStaticClientInfo>(rmw_subscriptions_t*, rmw_guard_conditions_t*, rmw_services_t*, rmw_clients_t*, rmw_time_t*) ()
   from /home/gerkey/ros2_ws/install/lib/librmw_connext_cpp.so
#6  0x00007feb1d9e040d in rmw_wait () from /home/gerkey/ros2_ws/install/lib/librmw_connext_cpp.so
#7  0x00007feb1d6e9d30 in rclcpp::executor::Executor::wait_for_work(std::chrono::duration<long, std::ratio<1l, 1000000000l> >) ()
   from /home/gerkey/ros2_ws/install/lib/librclcpp.so
#8  0x00007feb1d6eaea0 in rclcpp::executor::Executor::get_next_executable(std::chrono::duration<long, std::ratio<1l, 1000000000l> >)
    () from /home/gerkey/ros2_ws/install/lib/librclcpp.so
#9  0x00007feb1d6f2cfb in rclcpp::executors::single_threaded_executor::SingleThreadedExecutor::spin() ()
   from /home/gerkey/ros2_ws/install/lib/librclcpp.so
#10 0x00007feb1d6ee22c in rclcpp::spin(std::shared_ptr<rclcpp::node::Node>) () from /home/gerkey/ros2_ws/install/lib/librclcpp.so
#11 0x000000000043d75f in main ()

build src/ament/uncrustify fails

Uncrustify_Win32_2011.vcxproj: The application which this project type is based on was not found.

Looks like project was not migrated?

Move example_interfaces to a separate repository

The example_interfaces package is currently residing in the same repository as the rclcpp and rclpy examples, so if someone only needs the interfaces for building examples for other bindings (e.g. rcljava or rclobjc), they need to add an AMENT_IGNORE file to each package. It'd be a bit easier if the example_interfaces package could be fetched separately.

Cannot build (rclcpp) example using crystal branch

Bug report

Required Info:

  • Operating System:
    • Ubuntu 18.04.2 LTS
  • Installation type:
    • binaries
  • Version or commit hash:
    • Crystal (HEAD)
  • DDS implementation:
    • FastRTPS

Steps to reproduce issue

1. Fresh binary install of ROS2 Crystal
2. Fresh binary install of ROS1 Melodic
3. Fresh install ros1-bridge
4. Fresh install rosbag2
5. Follow instructions of [Using Colcon to build packages](https://index.ros.org/doc/ros2/Tutorials/Colcon-Tutorial/)
6. Create workspace
7. Clone repo
8. Build

Expected behavior

Built workspace

Actual behavior

mvelezce@config-crusher:~/Documents/programming/ros2/projects/ros2_example_ws$ colcon build --symlink-install
Starting >>> examples_rclcpp_minimal_action_client
Starting >>> examples_rclcpp_minimal_action_server
Starting >>> examples_rclcpp_minimal_client
Starting >>> examples_rclcpp_minimal_composition
Starting >>> examples_rclcpp_minimal_publisher
Starting >>> examples_rclcpp_minimal_service
Starting >>> examples_rclcpp_minimal_subscriber
Starting >>> examples_rclcpp_minimal_timer
--- stderr: examples_rclcpp_minimal_timer                                                                                                                                                                 
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [timer_lambda] Error 1
make[1]: *** [CMakeFiles/timer_lambda.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [timer_member_function] Error 1
make[1]: *** [CMakeFiles/timer_member_function.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< examples_rclcpp_minimal_timer	[ Exited with code 2 ]
--- stderr: examples_rclcpp_minimal_service                                                                                                                                                                          
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [service_main] Error 1
make[1]: *** [CMakeFiles/service_main.dir/all] Error 2
make: *** [all] Error 2
---
Aborted  <<< examples_rclcpp_minimal_service
--- stderr: examples_rclcpp_minimal_client                                                                                                                                                                            
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [client_main] Error 1
make[1]: *** [CMakeFiles/client_main.dir/all] Error 2
make: *** [all] Error 2
---
Aborted  <<< examples_rclcpp_minimal_client
--- stderr: examples_rclcpp_minimal_publisher                                                                                                                                                                              
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [publisher_lambda] Error 1
make[1]: *** [CMakeFiles/publisher_lambda.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [publisher_member_function] Error 1
make[1]: *** [CMakeFiles/publisher_member_function.dir/all] Error 2
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [publisher_not_composable] Error 1
make[1]: *** [CMakeFiles/publisher_not_composable.dir/all] Error 2
make: *** [all] Error 2
---
Aborted  <<< examples_rclcpp_minimal_publisher
--- stderr: examples_rclcpp_minimal_action_server                                                                                                                                                                           
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [action_server_not_composable] Error 1
make[1]: *** [CMakeFiles/action_server_not_composable.dir/all] Error 2
make: *** [all] Error 2
---
Aborted  <<< examples_rclcpp_minimal_action_server
--- stderr: examples_rclcpp_minimal_subscriber                                                                                                                                                                          
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [subscriber_member_function] Error 1
make[1]: *** [CMakeFiles/subscriber_member_function.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [subscriber_not_composable] Error 1
make[1]: *** [CMakeFiles/subscriber_not_composable.dir/all] Error 2
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [subscriber_lambda] Error 1
make[1]: *** [CMakeFiles/subscriber_lambda.dir/all] Error 2
make: *** [all] Error 2
---
Aborted  <<< examples_rclcpp_minimal_subscriber
--- stderr: examples_rclcpp_minimal_action_client                                                                                                                
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [action_client_not_composable_with_cancel] Error 1
make[1]: *** [CMakeFiles/action_client_not_composable_with_cancel.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [action_client_not_composable_with_feedback] Error 1
make[1]: *** [CMakeFiles/action_client_not_composable_with_feedback.dir/all] Error 2
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [action_client_not_composable] Error 1
make[1]: *** [CMakeFiles/action_client_not_composable.dir/all] Error 2
make: *** [all] Error 2
---
Aborted  <<< examples_rclcpp_minimal_action_client
--- stderr: examples_rclcpp_minimal_composition                                            
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [composition_subscriber] Error 1
make[1]: *** [CMakeFiles/composition_subscriber.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [composition_composed] Error 1
make[1]: *** [CMakeFiles/composition_composed.dir/all] Error 2
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/opt/ros/crystal/lib/librclcpp.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
collect2: error: ld returned 1 exit status
make[2]: *** [composition_publisher] Error 1
make[1]: *** [CMakeFiles/composition_publisher.dir/all] Error 2
make: *** [all] Error 2
---
Aborted  <<< examples_rclcpp_minimal_composition

Summary: 0 packages finished [11.9s]
  1 package failed: examples_rclcpp_minimal_timer
  7 packages aborted: examples_rclcpp_minimal_action_client examples_rclcpp_minimal_action_server examples_rclcpp_minimal_client examples_rclcpp_minimal_composition examples_rclcpp_minimal_publisher examples_rclcpp_minimal_service examples_rclcpp_minimal_subscriber
  8 packages had stderr output: examples_rclcpp_minimal_action_client examples_rclcpp_minimal_action_server examples_rclcpp_minimal_client examples_rclcpp_minimal_composition examples_rclcpp_minimal_publisher examples_rclcpp_minimal_service examples_rclcpp_minimal_subscriber examples_rclcpp_minimal_timer
  7 packages not processed

Additional information

Removing rclcpp directory builds the workspace without any issues.

mvelezce@config-crusher:~/Documents/programming/ros2/projects/ros2_example_ws$ colcon build --symlink-install
Starting >>> examples_rclpy_executors
Starting >>> examples_rclpy_minimal_action_client
Starting >>> examples_rclpy_minimal_action_server
Starting >>> examples_rclpy_minimal_client
Starting >>> examples_rclpy_minimal_publisher
Starting >>> examples_rclpy_minimal_service
Starting >>> examples_rclpy_minimal_subscriber
Finished <<< examples_rclpy_executors [2.21s]                                                                                                                                                             
Finished <<< examples_rclpy_minimal_action_client [2.16s]                                                                                                                                                         
Finished <<< examples_rclpy_minimal_action_server [2.16s]
Finished <<< examples_rclpy_minimal_client [2.16s]
Finished <<< examples_rclpy_minimal_publisher [2.17s]
Finished <<< examples_rclpy_minimal_service [2.17s]
Finished <<< examples_rclpy_minimal_subscriber [2.44s]          

Summary: 7 packages finished [2.70s]

examples do not build if without internet connection

If you are offline but have all the sources the examples does not build. (like say if you're hypothetically on a plane)

The reason is the osrf_pycommon depends on trollius which is not in the workspace so setup.py automatically downloads and installs it. If you're offline it fails like below.

--------------------------------------------------------------------------------
+++ Building 'osrf_pycommon'
+++ Installing 'osrf_pycommon'
==> '. /home/tfoote/work/ros2/test_param/build/osrf_pycommon/ament_python__install.sh && /home/tfoote/work/ros2/venv_ros2/bin/python3 setup.py develop --prefix /home/tfoote/work/ros2/test_param/install --script-dir /home/tfoote/work/ros2/test_param/install/bin' in '/home/tfoote/work/ros2/test_param/build/osrf_pycommon'
running develop
running egg_info
creating osrf_pycommon.egg-info
writing dependency_links to osrf_pycommon.egg-info/dependency_links.txt
writing requirements to osrf_pycommon.egg-info/requires.txt
writing top-level names to osrf_pycommon.egg-info/top_level.txt
writing osrf_pycommon.egg-info/PKG-INFO
writing manifest file 'osrf_pycommon.egg-info/SOURCES.txt'
reading manifest file 'osrf_pycommon.egg-info/SOURCES.txt'
writing manifest file 'osrf_pycommon.egg-info/SOURCES.txt'
running build_ext
Creating /home/tfoote/work/ros2/test_param/install/lib/python3.4/site-packages/site.py
Creating /home/tfoote/work/ros2/test_param/install/lib/python3.4/site-packages/osrf-pycommon.egg-link (link to .)
Adding osrf-pycommon 0.0.0 to easy-install.pth file

Installed /home/tfoote/work/ros2/test_param/build/osrf_pycommon
Processing dependencies for osrf-pycommon==0.0.0
Searching for trollius
Reading https://pypi.python.org/simple/trollius/
Download error on https://pypi.python.org/simple/trollius/: [Errno -2] Name or service not known -- Some packages may not be found!
Couldn't find index page for 'trollius' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [Errno -2] Name or service not known -- Some packages may not be found!
No local packages or download links found for trollius
error: Could not find suitable distribution for Requirement.parse('trollius')

<== Command '. /home/tfoote/work/ros2/test_param/build/osrf_pycommon/ament_python__install.sh && /home/tfoote/work/ros2/venv_ros2/bin/python3 setup.py develop --prefix /home/tfoote/work/ros2/test_param/install --script-dir /home/tfoote/work/ros2/test_param/install/bin' failed with exit code '1'

The quick fix for this is to add trollius to our bootstrap and then it will be there already. Longer term though we should probably have a way to check for and try to prevent tools from downloading and installing other packages.

problems about code style in ros2

I have test rclpy program in examples reps, and I'm confused about the comments "We do not recommend this style as ROS 2 provides timers for this purpose, and it is recommended that all nodes call a variation of spin." int file examples/rclpy/topics/minimal_publisher/publisher_local_function.py . Is it just a code style problem or that this will make difference to the performance of program ? I used to work in ros1, and familiar to the code style in file "publisher_local_function.py", need I change the code style ?

alpha2 build error

hi,
just a report: I build on rpi2B (arm) and when i run ament build --cmake-args -DCMAKE_BUILD_TYPE=Debug i get this error:

make[2]: *** [CMakeFiles/add_two_ints_client_async__rmw_opensplice_cpp.dir/src/services/add_two_ints_client_async.cpp.o] Error 1
make[2]: *** [CMakeFiles/add_two_ints_client_async.dir/src/services/add_two_ints_client_async.cpp.o] Error 1
make[1]: *** [CMakeFiles/add_two_ints_client_async.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/add_two_ints_client_async__rmw_opensplice_cpp.dir/all] Error 2
make[2]: *** [CMakeFiles/add_two_ints_client.dir/src/services/add_two_ints_client.cpp.o] Error 1
make[1]: *** [CMakeFiles/add_two_ints_client.dir/all] Error 2
/home/ubuntu/overlay_ws/src/examples/rclcpp_examples/src/services/add_two_ints_client.cpp: In function ‘example_interfaces::srv::AddTwoInts_Response_<std::allocator<void> >::SharedPtr send_request(rclcpp::node::Node::SharedPtr, rclcpp::client::Client<example_interfaces::srv::AddTwoInts>::SharedPtr, example_interfaces::srv::AddTwoInts_Request_<std::allocator<void> >::SharedPtr)’:
/home/ubuntu/overlay_ws/src/examples/rclcpp_examples/src/services/add_two_ints_client.cpp:36:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make[2]: *** [CMakeFiles/add_two_ints_client__rmw_opensplice_cpp.dir/src/services/add_two_ints_client.cpp.o] Error 1
make[1]: *** [CMakeFiles/add_two_ints_client__rmw_opensplice_cpp.dir/all] Error 2
make: *** [all] Error 2

<== Command '. /home/ubuntu/overlay_ws/build/rclcpp_examples/cmake__build.sh && /usr/bin/make -j4 -l4' failed with exit code '2'

service add two ints client/service example test is flakey

See:

http://ci.ros2.org/view/nightly/job/nightly_osx_debug/29/testReport/projectroot.Users.osrf.jenkins.workspace.nightly_osx_debug.ws.src.ros2.examples/rclcpp_examples/test_example_add_two_ints_server_add_two_ints_client__rmw_fastrtps_cpp/

If you search through the console output, you'll see that it is failing due to the test timeout. I can reproduce this on my machine (it is flakey).

If I start the server and then run the client in a loop I cannot reproduce the issue. So I'm going to look into a startup race condition again, as I believe it is still this issue: #93 (comment)

I'm not sure I can solve it, but I am going to try some things and at least we'll have an issue tracking this (I couldn't find one that is already open other than ros2/rclcpp#201 which is tracking a related feature but not the issue). I think tracking the issue is a good idea because it took me a while to figure out we had already looked into this because I looked at the open tickets on this repository and didn't see anything.

Errors in parameters examples using FastRTPS

I'm debugging the errors that arise on the nightly linux release in the parameters examples using FastRTPS.
Example error:

$ ./list_parameters__rmw_fastrtps_cpp 
terminate called after throwing an instance of 'eprosima::fastcdr::exception::BadParamException'
  what():  Bad parameter
Aborted (core dumped)

What I've found so far:

  • The examples fail only in the release build
  • They work fine in the default build and in the debug build.
$ ./list_parameters__rmw_fastrtps_cpp 
Parameter name: bar
Parameter name: foo
Parameter name: foo.first
Parameter name: foo.second
Parameter prefix: foo
  • I've tracked the exception and it's being raised here when fast-cdr tries to deserialize a bool.

Some questions:

  1. What can be changing in the release build to produce this?
  2. What kind of build is the default build (using no specific parameters)?

examples crash without a helpful error message when setup.bat isn't loaded

this might be a Windows-specific issue, but if you try to run talker.exe or examples_rclcpp_minimal_publisher_lambda.exe or basically anything (it seems?) without first calling local_setup.bat, Windows 10 pops up the generic "this program has stopped working" box. I'm not sure what the answer is, but it would be nicer to have a friendly error message instead.

compile error

I installed ros2-alpha6 successfully from source. Then I createed the overlay workspace and git clone the ros2 examples. When I compile the examples I got the following errors:
/home/user/overlay_ws/src/examples/rclcpp_examples/src/services/add_two_ints_client_async.cpp:30:19: error: ‘class rclcpp::client::Client<example_interfaces::srv::AddTwoInts>’ has no member named ‘wait_for_service’
while (!client->wait_for_service(1_s)) {
^
/home/user/overlay_ws/src/examples/rclcpp_examples/src/services/add_two_ints_client.cpp: In function ‘int main(int, char**)’:
/home/user/overlay_ws/src/examples/rclcpp_examples/src/services/add_two_ints_client.cpp:50:19: error: ‘class rclcpp::client::Client<example_interfaces::srv::AddTwoInts>’ has no member named ‘wait_for_service’
while (!client->wait_for_service(1_s)) {
^
/home/user/overlay_ws/src/examples/rclcpp_examples/src/services/add_two_ints_client.cpp: In function ‘int main(int, char**)’:
/home/user/overlay_ws/src/examples/rclcpp_examples/src/services/add_two_ints_client.cpp:50:19: error: ‘class rclcpp::client::Client<example_interfaces::srv::AddTwoInts>’ has no member named ‘wait_for_service’
while (!client->wait_for_service(1_s)) {
How can I solve this problem? Thanks.

improve names of executables and mention them in the readme

Currently the names are only discoverable by using the shell completion if you know that they start with examples_rclcpp_minimal_. They are not mentioned anywhere in the README files.

Also why having the suffix _main for examples_rclcpp_minimal_client_main?

Race in intra_process_demo node/subscription destruction

Bug report

Required Info:

  • Operating System:
    • macOS
  • Installation type:
    • Source
  • Version or commit hash:
    • Latest master code as of 2018-06-22 (examples git hash 45c0976)
  • DDS implementation:
    • Fast-RTPS
  • Client library (if applicable):
    • rclcpp

Steps to reproduce issue

$ ros2 run intra_process_demo image_pipeline_with_two_images_view

About 25% of the time, when killing this demo with Ctrl-C, I see:

[ERROR] [rclcpp]: Error in destruction of rcl subscription handle: the Node Handle was destructed too early. You will leak memory

Since this doesn't happen every time, this seems like some kind of race condition.

This was split out from #209 because while the symptom is the same, the underlying cause is probably not.

Expected behavior

Example exits gracefully.

Actual behavior

Example exits with error message about leaking memory.

Segmentation fault

Hi, All the examples experience a segmentation fault. This is the backtrace generated by GDB:

Starting program: /home/shadylady/ros2_ws/install/bin/imu32_publisher
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff5a1c700 (LWP 30491)]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bd3fab in rmw_create_publisher () from /home/shadylady/ros2_ws/install/lib/librmw_opensplice_cpp.so
(gdb) bt
#0 0x00007ffff7bd3fab in rmw_create_publisher () from /home/shadylady/ros2_ws/install/lib/librmw_opensplice_cpp.so
#1 0x0000000000458f34 in std::shared_ptrrclcpp::publisher::Publisher rclcpp::node::Node::create_publisher<simple_msgs::Imu32_<std::allocator > >(std::string, unsigned long) ()
#2 0x0000000000455649 in int publish<simple_msgs::Imu32_<std::allocator > >(std::shared_ptrrclcpp::node::Node, void (*)(simple_msgs::Imu32_std::allocator::Ptr&, unsigned long)) ()
#3 0x000000000044bf48 in main ()

Note that I download the opensplice library using the OSRF's Debian package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.