Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding parameter array support #443

Merged
merged 4 commits into from
May 10, 2018
Merged

Conversation

ayrton04
Copy link
Contributor

@ayrton04 ayrton04 commented Feb 20, 2018

To go with ros2/rcl_interfaces#32.

This PR includes the following:

  • Addition of parameter variants for byte arrays, bool arrays, int arrays, double arrays, and string arrays
  • Some method rearranging to match the enumeration in ParameterType.msg
  • Added a common method for printing arrays of values. Booleans print as true/false, and bytes are printed as hexadecimal with a 0x prefix.
  • I added tests for each parameter variant

Connects to ros2/rcl_interfaces#32

@mikaelarguedas
Copy link
Member

Thanks @ayrton04, as mentionned offline this should be the only set of changes we need for now. We could think of updating ros2param accordingly but I don't think it's worth the effort as ros2param will be replaced by a python version in the near future (and already doesnt support byte arrays anyway).

Thanks for the contribution and the tests! We'll try to review this soon

@mikaelarguedas mikaelarguedas added the in review Waiting for review (Kanban column) label Mar 12, 2018
@mikaelarguedas mikaelarguedas self-requested a review March 14, 2018 20:18
@mikaelarguedas mikaelarguedas added this to the bouncy milestone Mar 15, 2018
Copy link
Member

@mikaelarguedas mikaelarguedas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for taking so long to review this @ayrton04.

This looks good overall, I have a few comments inline, mostly style related.
I made come changes on this branch to fix the build on windows.

Some tests are still failing on windows though: https://ci.ros2.org/job/ci_windows/4229/testReport. Do you happen to have a windows environment to look into it?

RCLCPP_PUBLIC
std::string
value_to_string() const;
std::string value_to_string() const;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the motivation behind this change ? (removing the macro declaring that function as public)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this change breaks the build on windows and should be reverted (https://ci.ros2.org/job/ci_windows/4228/)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That appears to be the result of some poor merging on my part. Will fix.

@@ -189,10 +277,11 @@ ParameterVariant::to_parameter()
return parameter;
}

std::string
ParameterVariant::value_to_string() const
std::string ParameterVariant::value_to_string() const
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: please keep the existing style of return value on its own line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


EXPECT_EQ(double_variant.value_to_string(), "-42.100000");

const float TEST_VALUE_F {static_cast<float>(-TEST_VALUE)};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the - on purpose here ? Reusing the value used for the double but by performing operations on it appears to be a bit confusing to me. I also had to double check that the float_variant tests were actually independent of the double_variant as it's tested in the middle of the double_variant tests.
We could either test both the float_variant and the double_variant from message. Or just move the float test either a the very beginning of this test or into it's own test to avoid confusion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in here because float and double arrays get mapped to the same parameter type. I meant to follow the same pattern as above, with ints and long ints. Will review.

I was also trying to kill two birds with one stone: check that floats work, but also check for negative values.

Would you prefer that all variants, even when mapped to the same array type, have their own tests?

@@ -191,6 +191,16 @@ if(BUILD_TESTING)
target_link_libraries(test_node ${PROJECT_NAME})
endif()
ament_add_gtest(test_parameter_events_filter test/test_parameter_events_filter.cpp)
ament_add_gtest(test_parameter test/test_parameter.cpp)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this bloc should be added after the test_parameter_events_filter target check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor Author

@ayrton04 ayrton04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. I do have a Windows partition that occasionally sees the light of day. I can try building there.

@@ -191,6 +191,16 @@ if(BUILD_TESTING)
target_link_libraries(test_node ${PROJECT_NAME})
endif()
ament_add_gtest(test_parameter_events_filter test/test_parameter_events_filter.cpp)
ament_add_gtest(test_parameter test/test_parameter.cpp)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

RCLCPP_PUBLIC
std::string
value_to_string() const;
std::string value_to_string() const;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That appears to be the result of some poor merging on my part. Will fix.

@@ -189,10 +277,11 @@ ParameterVariant::to_parameter()
return parameter;
}

std::string
ParameterVariant::value_to_string() const
std::string ParameterVariant::value_to_string() const
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


EXPECT_EQ(double_variant.value_to_string(), "-42.100000");

const float TEST_VALUE_F {static_cast<float>(-TEST_VALUE)};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in here because float and double arrays get mapped to the same parameter type. I meant to follow the same pattern as above, with ints and long ints. Will review.

I was also trying to kill two birds with one stone: check that floats work, but also check for negative values.

Would you prefer that all variants, even when mapped to the same array type, have their own tests?

@ayrton04
Copy link
Contributor Author

OK, I didn't try in Windows yet, but I'm hoping I figured out the issue anyway. I was doing this previously:

const auto mismatches_get_param = std::mismatch(TEST_VALUE.begin(), TEST_VALUE.end(),
  integer_array_variant.get_parameter_value().integer_array_value.begin());
EXPECT_EQ(mismatches_get_param.first, TEST_VALUE.end());
EXPECT_EQ(mismatches_get_param.second,	
  integer_array_variant.get_parameter_value().integer_array_value.end());

But get_parameter_value returns value_, a member variable, so that should be returning a copy. Since I call the method twice, I get a different copy. Not sure why it was passing in Linux. I suppose the first one went out of scope, so when we asked for it again, we got the same chunk of memory.

Anyway, I changed that. I also explicitly separated out tests for float/double and integer/long integer types.

@mikaelarguedas
Copy link
Member

mikaelarguedas commented Mar 21, 2018

Thanks @ayrton04 for the quick follow-up, it looks good. I pushed another style fix and am running CI now to see if all platforms are happy with the change.

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@ayrton04
Copy link
Contributor Author

Great, thanks for that. Sorry about the flipped gtest params.

@mikaelarguedas
Copy link
Member

mikaelarguedas commented Mar 21, 2018

Sorry about the flipped gtest params

No worries, sed did most of the work :)


This change seems to have broken some communication tests on all platforms (list below).
I'm going to kill the jobs until we figure out what the issue and have a fix to test. I'll keep the arm job running to narrow down if the failures are only when talking between different rmw implementations.

 82% tests passed, 44 tests failed out of 241
 92 - test_publisher_subscriber__BoundedArrayNested__rclcpp__rclpy__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
 93 - test_publisher_subscriber__BoundedArrayPrimitives__rclcpp__rclpy__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
 94 - test_publisher_subscriber__Builtins__rclcpp__rclpy__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
 95 - test_publisher_subscriber__DynamicArrayNested__rclcpp__rclpy__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
 96 - test_publisher_subscriber__DynamicArrayPrimitives__rclcpp__rclpy__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
 97 - test_publisher_subscriber__DynamicArrayPrimitivesNested__rclcpp__rclpy__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
 98 - test_publisher_subscriber__Empty__rclcpp__rclpy__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
 99 - test_publisher_subscriber__Nested__rclcpp__rclpy__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
100 - test_publisher_subscriber__Primitives__rclcpp__rclpy__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
101 - test_publisher_subscriber__StaticArrayNested__rclcpp__rclpy__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
102 - test_publisher_subscriber__StaticArrayPrimitives__rclcpp__rclpy__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
105 - test_publisher_subscriber__BoundedArrayNested__rclcpp__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
106 - test_publisher_subscriber__BoundedArrayPrimitives__rclcpp__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
107 - test_publisher_subscriber__Builtins__rclcpp__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
108 - test_publisher_subscriber__DynamicArrayNested__rclcpp__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
109 - test_publisher_subscriber__DynamicArrayPrimitives__rclcpp__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
110 - test_publisher_subscriber__DynamicArrayPrimitivesNested__rclcpp__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
111 - test_publisher_subscriber__Empty__rclcpp__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
112 - test_publisher_subscriber__Nested__rclcpp__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
113 - test_publisher_subscriber__Primitives__rclcpp__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
114 - test_publisher_subscriber__StaticArrayNested__rclcpp__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
115 - test_publisher_subscriber__StaticArrayPrimitives__rclcpp__rmw_connext_cpp__rmw_fastrtps_cpp (Timeout)
144 - test_publisher_subscriber__BoundedArrayNested__rclpy__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
145 - test_publisher_subscriber__BoundedArrayPrimitives__rclpy__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
146 - test_publisher_subscriber__Builtins__rclpy__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
147 - test_publisher_subscriber__DynamicArrayNested__rclpy__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
148 - test_publisher_subscriber__DynamicArrayPrimitives__rclpy__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
149 - test_publisher_subscriber__DynamicArrayPrimitivesNested__rclpy__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
150 - test_publisher_subscriber__Empty__rclpy__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
151 - test_publisher_subscriber__Nested__rclpy__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
152 - test_publisher_subscriber__Primitives__rclpy__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
153 - test_publisher_subscriber__StaticArrayNested__rclpy__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
154 - test_publisher_subscriber__StaticArrayPrimitives__rclpy__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
170 - test_publisher_subscriber__BoundedArrayNested__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
171 - test_publisher_subscriber__BoundedArrayPrimitives__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
172 - test_publisher_subscriber__Builtins__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
173 - test_publisher_subscriber__DynamicArrayNested__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
174 - test_publisher_subscriber__DynamicArrayPrimitives__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
175 - test_publisher_subscriber__DynamicArrayPrimitivesNested__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
176 - test_publisher_subscriber__Empty__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
177 - test_publisher_subscriber__Nested__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
178 - test_publisher_subscriber__Primitives__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
179 - test_publisher_subscriber__StaticArrayNested__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)
180 - test_publisher_subscriber__StaticArrayPrimitives__rclcpp__rmw_fastrtps_cpp__rmw_connext_cpp (Timeout)

Edit:
Notes to self:

  • Issue happens only when Fast-RTPS and Connext are involved.
  • Only when services are enable, a simply Python pub sub using the same message type works fine
  • FastRTPS throws error at discovery time about payload being bigger than default history size.
    It uses the default of 5000 bytes, if the default memory strategy for the history of the endpoints is to reallocate the issue doesn't happen
  • Haven't seen a way to pass the memory strategy to the Participant creation functions to work around it

Stack trace with break point each time the default history attributes are used:

#0  eprosima::fastrtps::rtps::HistoryAttributes::HistoryAttributes (
    this=0x7fffffff2360)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/include/fastrtps/rtps/history/../attributes/HistoryAttributes.h:47
#1  0x00007ffff41c8fe3 in eprosima::fastrtps::rtps::PDPSimple::createSPDPEndpoints (this=0x74a020)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp:421
#2  0x00007ffff41c7973 in eprosima::fastrtps::rtps::PDPSimple::initPDP (
    this=0x74a020, part=0x747980)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp:168
#3  0x00007ffff41c61d2 in eprosima::fastrtps::rtps::BuiltinProtocols::initBuiltinProtocols (this=0x749de0, p_part=0x747980, attributes=...)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/builtin/BuiltinProtocols.cpp:74
#4  0x00007ffff416f0bc in eprosima::fastrtps::rtps::RTPSParticipantImpl::RTPSParticipantImpl (this=0x747980, PParam=..., guidP=..., par=0x7478b0, 
    plisten=0x747560)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/---Type <return> to continue, or q <return> to quit---
participant/RTPSParticipantImpl.cpp:332
#5  0x00007ffff41779b5 in eprosima::fastrtps::rtps::RTPSDomain::createParticipant (PParam=..., listen=0x747560)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/RTPSDomain.cpp:145
#6  0x00007ffff417a1b5 in eprosima::fastrtps::Domain::createParticipant (att=..., listen=0x7472f0)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/Domain.cpp:137
#7  0x00007ffff47af9a4 in create_node (name=0x7fffffff3f70 "listener", namespace_=0x7ffff749c8c2 "/", participantAttrs=...)
    at /home/mikael/work/ros2/current_ws/src/ros2/rmw_fastrtps/rmw_fastrtps_cpp/src/rmw_node.cpp:84
#8  0x00007ffff47b0871 in rmw_create_node (name=0x7fffffff3f70 "listener", namespace_=0x7ffff749c8c2 "/", domain_id=42, security_options=0x7fffffff3b30)
    at /home/mikael/work/ros2/current_ws/src/ros2/rmw_fastrtps/rmw_fastrtps_cpp/src/rmw_node.cpp:277
#9  0x00007ffff62f70bb in rmw_create_node (v4=0x7fffffff3f70 "listener", v3=0x7ffff749c8c2 "/", v2=42, v1=0x7fffffff3b30)
    at /home/mikael/work/ros2/current_ws/src/ros2/rmw_implementation/rmw_implementation/src/functions.cpp:222
#10 0x00007ffff748d0e2 in rcl_node_init (node=0x7471a0, name=0x7fffffff3f70 "listener", namespace_=0x7fffffff3f90 "", options=0x7fffffff3c90)
    at /home/mikael/work/ros2/current_ws/src/ros2/rcl/rcl/src/rcl/node.c:331
#11 0x00007ffff7a79e05 in rclcpp::node_interfaces::NodeBase::NodeBase (this=0x7470c0, node_name="listener", namespace_="", 
    context=std::shared_ptr (expired, weak 0) 0x7fffffff3e30)
    at /home/mikael/work/ros2/current_ws/src/ros2/rclcpp/rclcpp/src/rclcpp/node_interfaces/node_base.cpp:92
#12 0x00007ffff7a77021 in rclcpp::Node::Node (this=0x746f80, node_name="listener", namespace_="", 
    context=std::shared_ptr (expired, weak 0) 0x7fffffff3eb0, use_intra_process_comms=false)
    at /home/mikael/work/ros2/current_ws/src/ros2/rclcpp/rclcpp/src/rclcpp/node.cpp:54
#13 0x00007ffff7a76f11 in rclcpp::Node::Node (this=0x746f80, node_name="listener", namespace_="", use_intra_process_comms=false)
    at /home/mikael/work/ros2/current_ws/src/ros2/rclcpp/rclcpp/src/rclcpp/node.cpp:46
#14 0x000000000040c607 in Listener::Listener (this=0x746f80, topic_name="chatter")
    at /home/mikael/work/ros2/current_ws/src/ros2/demos/demo_nodes_cpp/src/topics/listener.cpp:39
#15 0x00000000004150c0 in __gnu_cxx::new_allocator<Listener>::construct<Listener, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x7fffffff40c7, __p=0x746f80) at /usr/include/c++/5/ext/new_allocator.h:120
#16 0x00000000004145fa in std::allocator_traits<std::allocator<Listener> >::construct<Listener, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (__a=..., __p=0x746f80) at /usr/include/c++/5/bits/alloc_traits.h:530
#17 0x00000000004133a8 in std::_Sp_counted_ptr_inplace<Listener, std::allocator<Listener>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x746f70, __a=...) at /usr/include/c++/5/bits/shared_ptr_base.h:522
#18 0x0000000000411ccf in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<Listener, std::allocator<Listener>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x7fffffff4288, __a=...) at /usr/include/c++/5/bits/shared_ptr_base.h:617
#19 0x00000000004105ee in std::__shared_ptr<Listener, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<Listener>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x7fffffff4280, __tag=..., __a=...) at /usr/include/c++/5/bits/shared_ptr_base.h:1097
#20 0x000000000040ec64 in std::shared_ptr<Listener>::shared_ptr<std::allocator<Listener>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x7fffffff4280, __tag=..., __a=...) at /usr/include/c++/5/bits/shared_ptr.h:319
#21 0x000000000040d704 in std::allocate_shared<Listener, std::allocator<Listener>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (__a=...) at /usr/include/c++/5/bits/shared_ptr.h:620
#22 0x000000000040ce2b in std::make_shared<Listener, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> ()
    at /usr/include/c++/5/bits/shared_ptr.h:636
#23 0x000000000040bdac in main (argc=1, argv=0x7fffffff43e8) at /home/mikael/work/ros2/current_ws/src/ros2/demos/demo_nodes_cpp/src/topics/listener.cpp:82
(gdb) continue
Continuing.
[New Thread 0x7ffff0979700 (LWP 25039)]

Thread 1 "listener" hit Breakpoint 2, eprosima::fastrtps::rtps::HistoryAttributes::HistoryAttributes (this=0x7fffffff2350)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/include/fastrtps/rtps/history/../attributes/HistoryAttributes.h:47
47	    {}


(gdb) bt
#0  eprosima::fastrtps::rtps::HistoryAttributes::HistoryAttributes (this=0x7fffffff2350)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/include/fastrtps/rtps/history/../attributes/HistoryAttributes.h:47
#1  0x00007ffff41d87d7 in eprosima::fastrtps::rtps::EDPSimple::createSEDPEndpoints (this=0x938b40)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp:112
#2  0x00007ffff41d8659 in eprosima::fastrtps::rtps::EDPSimple::initEDP (this=0x938b40, attributes=...)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp:98
#3  0x00007ffff41c7bfc in eprosima::fastrtps::rtps::PDPSimple::initPDP (this=0x74a020, part=0x747980)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp:188
#4  0x00007ffff41c61d2 in eprosima::fastrtps::rtps::BuiltinProtocols::initBuiltinProtocols (this=0x749de0, p_part=0x747980, attributes=...)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/builtin/BuiltinProtocols.cpp:74
#5  0x00007ffff416f0bc in eprosima::fastrtps::rtps::RTPSParticipantImpl::RTPSParticipantImpl (this=0x747980, PParam=..., guidP=..., par=0x7478b0, 
    plisten=0x747560) at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/participant/RTPSParticipantImpl.cpp:332
#6  0x00007ffff41779b5 in eprosima::fastrtps::rtps::RTPSDomain::createParticipant (PParam=..., listen=0x747560)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/RTPSDomain.cpp:145
#7  0x00007ffff417a1b5 in eprosima::fastrtps::Domain::createParticipant (att=..., listen=0x7472f0)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/Domain.cpp:137
#8  0x00007ffff47af9a4 in create_node (name=0x7fffffff3f70 "listener", namespace_=0x7ffff749c8c2 "/", participantAttrs=...)
    at /home/mikael/work/ros2/current_ws/src/ros2/rmw_fastrtps/rmw_fastrtps_cpp/src/rmw_node.cpp:84
#9  0x00007ffff47b0871 in rmw_create_node (name=0x7fffffff3f70 "listener", namespace_=0x7ffff749c8c2 "/", domain_id=42, security_options=0x7fffffff3b30)
    at /home/mikael/work/ros2/current_ws/src/ros2/rmw_fastrtps/rmw_fastrtps_cpp/src/rmw_node.cpp:277
#10 0x00007ffff62f70bb in rmw_create_node (v4=0x7fffffff3f70 "listener", v3=0x7ffff749c8c2 "/", v2=42, v1=0x7fffffff3b30)
    at /home/mikael/work/ros2/current_ws/src/ros2/rmw_implementation/rmw_implementation/src/functions.cpp:222
#11 0x00007ffff748d0e2 in rcl_node_init (node=0x7471a0, name=0x7fffffff3f70 "listener", namespace_=0x7fffffff3f90 "", options=0x7fffffff3c90)
    at /home/mikael/work/ros2/current_ws/src/ros2/rcl/rcl/src/rcl/node.c:331
#12 0x00007ffff7a79e05 in rclcpp::node_interfaces::NodeBase::NodeBase (this=0x7470c0, node_name="listener", namespace_="", 
    context=std::shared_ptr (expired, weak 0) 0x7fffffff3e30)
    at /home/mikael/work/ros2/current_ws/src/ros2/rclcpp/rclcpp/src/rclcpp/node_interfaces/node_base.cpp:92
#13 0x00007ffff7a77021 in rclcpp::Node::Node (this=0x746f80, node_name="listener", namespace_="", 
    context=std::shared_ptr (expired, weak 0) 0x7fffffff3eb0, use_intra_process_comms=false)
    at /home/mikael/work/ros2/current_ws/src/ros2/rclcpp/rclcpp/src/rclcpp/node.cpp:54
#14 0x00007ffff7a76f11 in rclcpp::Node::Node (this=0x746f80, node_name="listener", namespace_="", use_intra_process_comms=false)
    at /home/mikael/work/ros2/current_ws/src/ros2/rclcpp/rclcpp/src/rclcpp/node.cpp:46
#15 0x000000000040c607 in Listener::Listener (this=0x746f80, topic_name="chatter")
    at /home/mikael/work/ros2/current_ws/src/ros2/demos/demo_nodes_cpp/src/topics/listener.cpp:39
#16 0x00000000004150c0 in __gnu_cxx::new_allocator<Listener>::construct<Listener, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x7fffffff40c7, __p=0x746f80) at /usr/include/c++/5/ext/new_allocator.h:120
#17 0x00000000004145fa in std::allocator_traits<std::allocator<Listener> >::construct<Listener, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (__a=..., __p=0x746f80) at /usr/include/c++/5/bits/alloc_traits.h:530
#18 0x00000000004133a8 in std::_Sp_counted_ptr_inplace<Listener, std::allocator<Listener>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x746f70, __a=...) at /usr/include/c++/5/bits/shared_ptr_base.h:522
#19 0x0000000000411ccf in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<Listener, std::allocator<Listener>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x7fffffff4288, __a=...) at /usr/include/c++/5/bits/shared_ptr_base.h:617
#20 0x00000000004105ee in std::__shared_ptr<Listener, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<Listener>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x7fffffff4280, __tag=..., __a=...) at /usr/include/c++/5/bits/shared_ptr_base.h:1097
#21 0x000000000040ec64 in std::shared_ptr<Listener>::shared_ptr<std::allocator<Listener>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x7fffffff4280, __tag=..., __a=...) at /usr/include/c++/5/bits/shared_ptr.h:319
#22 0x000000000040d704 in std::allocate_shared<Listener, std::allocator<Listener>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (__a=...) at /usr/include/c++/5/bits/shared_ptr.h:620
#23 0x000000000040ce2b in std::make_shared<Listener, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> ()
    at /usr/include/c++/5/bits/shared_ptr.h:636
#24 0x000000000040bdac in main (argc=1, argv=0x7fffffff43e8) at /home/mikael/work/ros2/current_ws/src/ros2/demos/demo_nodes_cpp/src/topics/listener.cpp:82
(gdb) continue 
Continuing.

Thread 1 "listener" hit Breakpoint 2, eprosima::fastrtps::rtps::HistoryAttributes::HistoryAttributes (this=0x7fffffff2550)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/include/fastrtps/rtps/history/../attributes/HistoryAttributes.h:47
47	    {}



(gdb) bt
#0  eprosima::fastrtps::rtps::HistoryAttributes::HistoryAttributes (
    this=0x7fffffff2550)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/include/fastrtps/rtps/history/../attributes/HistoryAttributes.h:47
#1  0x00007ffff41dfce1 in eprosima::fastrtps::rtps::WLP::createEndpoints (
    this=0xc00d10)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/builtin/liveliness/WLP.cpp:87
#2  0x00007ffff41dfcac in eprosima::fastrtps::rtps::WLP::initWL (
    this=0xc00d10, p=0x747980)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/builtin/liveliness/WLP.cpp:81
#3  0x00007ffff41c630f in eprosima::fastrtps::rtps::BuiltinProtocols::initBuiltinProtocols (this=0x749de0, p_part=0x747980, attributes=...)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/builtin/BuiltinProtocols.cpp:81
#4  0x00007ffff416f0bc in eprosima::fastrtps::rtps::RTPSParticipantImpl::RTPSParticipantImpl (this=0x747980, PParam=..., guidP=..., par=0x7478b0, 
    plisten=0x747560)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/---Type <return> to continue, or q <return> to quit---
participant/RTPSParticipantImpl.cpp:332
#5  0x00007ffff41779b5 in eprosima::fastrtps::rtps::RTPSDomain::createParticipant (PParam=..., listen=0x747560)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/rtps/RTPSDomain.cpp:145
#6  0x00007ffff417a1b5 in eprosima::fastrtps::Domain::createParticipant (att=..., listen=0x7472f0)
    at /home/mikael/work/ros2/current_ws/src/eProsima/Fast-RTPS/src/cpp/Domain.cpp:137
#7  0x00007ffff47af9a4 in create_node (name=0x7fffffff3f70 "listener", namespace_=0x7ffff749c8c2 "/", participantAttrs=...)
    at /home/mikael/work/ros2/current_ws/src/ros2/rmw_fastrtps/rmw_fastrtps_cpp/src/rmw_node.cpp:84
#8  0x00007ffff47b0871 in rmw_create_node (name=0x7fffffff3f70 "listener", namespace_=0x7ffff749c8c2 "/", domain_id=42, security_options=0x7fffffff3b30)
    at /home/mikael/work/ros2/current_ws/src/ros2/rmw_fastrtps/rmw_fastrtps_cpp/src/rmw_node.cpp:277
#9  0x00007ffff62f70bb in rmw_create_node (v4=0x7fffffff3f70 "listener", v3=0x7ffff749c8c2 "/", v2=42, v1=0x7fffffff3b30)
    at /home/mikael/work/ros2/current_ws/src/ros2/rmw_implementation/rmw_implementation/src/functions.cpp:222
#10 0x00007ffff748d0e2 in rcl_node_init (node=0x7471a0, name=0x7fffffff3f70 "listener", namespace_=0x7fffffff3f90 "", options=0x7fffffff3c90)
    at /home/mikael/work/ros2/current_ws/src/ros2/rcl/rcl/src/rcl/node.c:331
#11 0x00007ffff7a79e05 in rclcpp::node_interfaces::NodeBase::NodeBase (this=0x7470c0, node_name="listener", namespace_="", 
    context=std::shared_ptr (expired, weak 0) 0x7fffffff3e30)
    at /home/mikael/work/ros2/current_ws/src/ros2/rclcpp/rclcpp/src/rclcpp/node_interfaces/node_base.cpp:92
#12 0x00007ffff7a77021 in rclcpp::Node::Node (this=0x746f80, node_name="listener", namespace_="", 
    context=std::shared_ptr (expired, weak 0) 0x7fffffff3eb0, use_intra_process_comms=false)
    at /home/mikael/work/ros2/current_ws/src/ros2/rclcpp/rclcpp/src/rclcpp/node.cpp:54
#13 0x00007ffff7a76f11 in rclcpp::Node::Node (this=0x746f80, node_name="listener", namespace_="", use_intra_process_comms=false)
    at /home/mikael/work/ros2/current_ws/src/ros2/rclcpp/rclcpp/src/rclcpp/node.cpp:46
#14 0x000000000040c607 in Listener::Listener (this=0x746f80, topic_name="chatter")
    at /home/mikael/work/ros2/current_ws/src/ros2/demos/demo_nodes_cpp/src/topics/listener.cpp:39
#15 0x00000000004150c0 in __gnu_cxx::new_allocator<Listener>::construct<Listener, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x7fffffff40c7, __p=0x746f80) at /usr/include/c++/5/ext/new_allocator.h:120
#16 0x00000000004145fa in std::allocator_traits<std::allocator<Listener> >::construct<Listener, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (__a=..., __p=0x746f80) at /usr/include/c++/5/bits/alloc_traits.h:530
#17 0x00000000004133a8 in std::_Sp_counted_ptr_inplace<Listener, std::allocator<Listener>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x746f70, __a=...) at /usr/include/c++/5/bits/shared_ptr_base.h:522
#18 0x0000000000411ccf in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<Listener, std::allocator<Listener>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x7fffffff4288, __a=...) at /usr/include/c++/5/bits/shared_ptr_base.h:617
#19 0x00000000004105ee in std::__shared_ptr<Listener, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<Listener>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x7fffffff4280, __tag=..., __a=...) at /usr/include/c++/5/bits/shared_ptr_base.h:1097
#20 0x000000000040ec64 in std::shared_ptr<Listener>::shared_ptr<std::allocator<Listener>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (this=0x7fffffff4280, __tag=..., __a=...) at /usr/include/c++/5/bits/shared_ptr.h:319
#21 0x000000000040d704 in std::allocate_shared<Listener, std::allocator<Listener>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (__a=...) at /usr/include/c++/5/bits/shared_ptr.h:620
#22 0x000000000040ce2b in std::make_shared<Listener, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> ()
    at /usr/include/c++/5/bits/shared_ptr.h:636
#23 0x000000000040bdac in main (argc=1, argv=0x7fffffff43e8) at /home/mikael/work/ros2/current_ws/src/ros2/demos/demo_nodes_cpp/src/topics/listener.cpp:82
(gdb) continue 

@mikaelarguedas
Copy link
Member

mikaelarguedas commented Mar 21, 2018

It looks like when it's only Fast-RTPS talking to itself it works.
I can reproduce the failures locally when trying to get Connext to talk to Fast-RTPS. Do you happen to have a way to test that configuration?

@ayrton04
Copy link
Contributor Author

I can't say that I do, no. My workspace contains really only what I required to get this to build and pass its tests. I'm not familiar with the RMW, but am happy to do what I can to investigate.

@ayrton04
Copy link
Contributor Author

I just ran the test_communication tests locally, and they all passed, but then I don't have Connext. The OpenSplice/Fast-RTPS tests appear to be fine, though:

100% tests passed, 0 tests failed out of 241

Label Time Summary:
copyright     =   0.43 sec (1 test)
cppcheck      =   0.54 sec (1 test)
cpplint       =   0.91 sec (1 test)
flake8        =   0.65 sec (1 test)
gtest         =  16.39 sec (2 tests)
lint_cmake    =   0.38 sec (1 test)
linter        =   3.99 sec (7 tests)
pep257        =   0.45 sec (1 test)
pytest        = 371.78 sec (208 tests)
uncrustify    =   0.63 sec (1 test)

@ayrton04
Copy link
Contributor Author

Just checking in. Is there anything I could be doing on my end to aid in fixing the issue?

@mikaelarguedas
Copy link
Member

Just checking in. Is there anything I could be doing on my end to aid in fixing the issue?

Sorry for the delay, now that the underlying issue has been resolved (ros2/rmw_connext#288), we can move forward on this. I just pushed a rebased version of this branch that I'll use for testing and CI

@ayrton04
Copy link
Contributor Author

ayrton04 commented May 9, 2018

Nice! Thanks for the info. Let me know if I can assist in any way.

@mikaelarguedas
Copy link
Member

The code still looks good to me 👍

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Debug:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

With demos using parameter arrays from ros2/demos#235:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Copy link
Member

@mikaelarguedas mikaelarguedas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @ayrton04 !

@ayrton04
Copy link
Contributor Author

Any time!

@mikaelarguedas mikaelarguedas merged commit 15d505e into ros2:master May 10, 2018
@mikaelarguedas mikaelarguedas removed the in review Waiting for review (Kanban column) label May 10, 2018
@mikaelarguedas
Copy link
Member

Thanks @ayrton04 for the feature addition and the patience 👍

@ayrton04 ayrton04 deleted the parameter-arrays branch May 14, 2018 05:40
nnmm pushed a commit to ApexAI/rclcpp that referenced this pull request Jul 9, 2022
Signed-off-by: Abby Xu <abbyxu@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants