Comments (4)
The intraprocess communications still use DDS to pass information. So, I wouldn't expect it to behave any differently.
I'll look at the test, but these demos do work: https://github.com/ros2/ros2/wiki/Intra-Process-Communication
from rclcpp.
So, my theory as to why your test doesn't work, but my demos do, is that your test finishes before the two DDS participants have had time to discover each other. My demos just don't start working until the discovery process is complete, see:
I added a sleep in your test and it passes:
diff --git a/test_rclcpp/test/test_intra_process.cpp b/test_rclcpp/test/test_intra_process.cpp
index 7dc3c64..17126d7 100644
--- a/test_rclcpp/test/test_intra_process.cpp
+++ b/test_rclcpp/test/test_intra_process.cpp
@@ -201,6 +201,8 @@ TEST(test_intra_process_two_nodes, nominal_usage) {
publisher->publish(msg);
ASSERT_EQ(0, counter);
+ rclcpp::sleep_for(1_s);
+
// wait for the first callback
{
size_t i = 0;
@@ -231,10 +233,12 @@ TEST(test_intra_process_two_nodes, nominal_usage) {
publisher->publish(msg);
ASSERT_EQ(1, counter);
+ rclcpp::sleep_for(1_s);
+
int i = 0;
while (counter < 5 && i < 5) {
executor.spin_some();
- printf("spin_some() - %zu/5\n", ++i);
+ printf("spin_some() - %i/5\n", ++i);
}
ASSERT_EQ(5, counter);
@@ -248,7 +252,8 @@ TEST(test_intra_process_two_nodes, nominal_usage) {
// check that no further callbacks have been invoked
printf("spin_node_some() - no callbacks expected\n");
- executor.spin_node_some(node1);
- executor.spin_node_some(node2);
+ rclcpp::executors::SingleThreadedExecutor executor2;
+ executor2.spin_node_some(node1);
+ executor2.spin_node_some(node2);
ASSERT_EQ(5, counter);
}
(some other small fixes in there)
from rclcpp.
duplicate of ros2/rmw_connext#112
from rclcpp.
I'm going to close this out since it is a duplicate.
from rclcpp.
Related Issues (20)
- TimersManager doesn't follow ROS time HOT 2
- rclcpp_action: Provide enum class return ClientGoalHandle::get_status
- Callback works on Galactic but fails on Rolling - handle_message is not implemented for GenericSubscription HOT 1
- Clang warning: ordered comparison of function pointers (Rolling) HOT 1
- `-fanalyzer` warning: possible null dereference when using TypeAdapters HOT 4
- leak due to std::shared_ptr circular reference between Context and GuardCondition HOT 3
- :farmer: `rclcpp.test_executors` failing in Rolling and Jazzy CycloneDDS HOT 2
- rclcpp::Time(int64_t nanoseconds, ...) should check for negative time
- Regression : Executor::spin_some_impl is active waiting HOT 5
- Parameter service behavior is inconsistent with the documentation of rcl_interfaces HOT 9
- Lifecycle destructor calls shutdown while in shuttingdown intermediate state HOT 45
- Backport PR2063 to Humble for Windows HOT 2
- Executor callbacks are no longer in a predictable order HOT 25
- '/clock' Topic cannot change each loop step time from simulation time HOT 10
- Program exits with code -11 when using async_send_request to set parameters in ROS 2 C++ client HOT 1
- Timer callbacks can be delayed when using simulation time HOT 4
- Possible regression in rcl preshutdown callbacks - context invalid? HOT 11
- Shutdown transition on base lifecycle node dtor may lead to segaults on subclass-registered shutdown callback HOT 6
- `on_shutdown` callback not called when `shutdown` transition is triggered on dtor HOT 2
- ABI/API Compliance Checker in github workflow HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rclcpp.