Open aprotyas opened 3 years ago
I've targeted this PR to the galactic
branch, but will change that ASAP if the maintainers could push a foxy
branch off of the current repository head.
@aprotyas Thanks for working on this :) I've retargeted the PR to foxy
(which is based on galactic
).
I've also pushed a commit to your branch to make CI target Foxy (cce4273).
@jacobperron thanks for retargeting to foxy
.
Question: from the TODOs in the PR description, should the preference be to backport the PRs which introduced said rclcpp
functionality, or to opt for the alternative methods I listed (usually just falling back to the rmw
/rcl
headers)? The latter option is nontrivial for the rclcpp::*Policy
enum classes and almost impossible for rclcpp::InitOptions::set_domain_id
, but I've already done that for rclcpp::Context::get_domain_id
in 925a5e1.
EDIT (10/30)
Alright, so domain_bridge_lib
and its tests successfully compile now, but there are a bunch of test failues. It looks like they're almost all related to the fact that the domain ID is not set correctly.
There really does seem to be no way to set the domain ID. Thoughts?
Hi. I just tried to test this branch with with ROS foxy, but i encountered an error when a node begins to publish some data. I used the example_bridge_config.yaml
file as mentioned in the readme file and published data in the chatter
topic. the error is:
terminate called after throwing an instance of 'std::runtime_error'
what(): unexpected callback being called
this is my example_bridge_config.yaml
file:
name: my_bridge
from_domain: 0
to_domain: 3
topics:
chatter:
type: example_interfaces/msg/String
am i missing something alongway doing it or it's a known issue?
@antonyramsy this branch was still WIP and I didn't have enough bandwidth to get back to it for a while now.
I remember seeing these errors when I was testing this branch too, and the problem was that in Foxy, rcl
offers no such API to set domain IDs -- check https://github.com/ros2/domain_bridge/pull/60#discussion_r742555634 for what I'd already (unsuccessfully) tried. I just never had time to fully verify that my approach in https://github.com/ros2/domain_bridge/pull/60/commits/efa97ae33fed98103a5030cf70e605dc7295ea1a works.
I might have some time to revive this PR soon-ish, but if you need this branch to work soon I think the way to go would be to run the tests in this package and debug the errors from there. As it is, I think your configuration is correct but the branch is not ready to land.
@aprotyas Thanks a lot for the response. I will consider using this package along with other approaches i can take, and will inform if any progress in the development has taken place.
@jacobperron as of ff41c31, the end-to-end tests pass in this branch. I'm still struggling against the default lifespan and deadline values in QOS profiles.
From https://github.com/ros2/rmw/pull/301#pullrequestreview-595709837, it looks like in Foxy, the default zero values for the lifespan and deadline means each RMW uses its own default value, which is difficult to test against compared to the "max" duration enforced post-Foxy (i.e. rclcpp::Duration(std::numeric_limits<int64_t>::max())
). Is there a way around this?
@antonyramsy, this branch may be good to go now. If possible, can you test this branch out?
@antonyramsy it looks like you're using a Humble distribution as your underlay, can you change to Foxy?
On Wed, Jun 1, 2022, 07:02 antonyramsy @.***> wrote:
@aprotyas https://github.com/aprotyas I've tested this branch. first i got this error:
CMake Deprecation Warning at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_target_interfaces.cmake:32 (message): Use rosidl_get_typesupport_target() and target_link_libraries() instead of rosidl_target_interfaces()
and changed rosidl_target_interfaces() with rosidl_get_typesupport_target(). after that another error appeared which looks like the message is not being created:
Starting >>> domain_bridge --- stderr: domain_bridge ~/domain_bridge_ws/src/src/domain_bridge/domain_bridge.cpp:43:10: fatal error: domain_bridge/msg/compressed_msg.hpp: No such file or directory 43 | #include "domain_bridge/msg/compressed_msg.hpp" | ^
~~~~~~~~~ compilation terminated.full text log: log.txt https://github.com/ros2/domain_bridge/files/8813437/log.txt
— Reply to this email directly, view it on GitHub https://github.com/ros2/domain_bridge/pull/60#issuecomment-1143456598, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIHOFW5JCS4Q4MZUC4HTPHDVM47L3ANCNFSM5G4JDZEQ . You are receiving this because you were mentioned.Message ID: @.***>
@aprotyas Hi, sorry for delay. I've tested the updated code both on foxy and humble. in normal condition(sending some data in one domain and receiving it in another one) both of them are ok. but i realized that bidirectional bridging in ROS foxy is not working as i expect (maybe i'm doing it in the wrong way) but in humble it works fine(by using the same YAML config file in different versions of ROS). here is the config i'm using to test bidirectional bridge:
name: my_bridge
from_domain: 2
to_domain: 3
topics:
chatter:
type: example_interfaces/msg/String
remap: chitter
bidirectional: True
with this config i was able to publish some date on topic chatter
from domain 2 and receive it in domain 3 under chitter
topic. and vice versa(publishing in domain 3 in topic chatter
and receiving it in domain 2 in topic chitter
) in ROS humble.
but doing the same in ROS foxy, although you are able to send data from domain 2 to 3, but you wont be able to see published data from domain 3 in topic chatter
in domain 2 in topic chitter
(the topic chitter
does not show up in ros2 topic list
command result.)
PR description
This PR attempts to make
domain_bridge
a Foxy-compatible package - based off of thegalactic
branch.The following changes have been introduced:
GenericPublisher
/GenericSubscription
classes to this package's source tree. https://github.com/ros2/domain_bridge/pull/60/commits/0c05dab08241af7e4c2695a600e323b1eefd1166rosidl_target_interfaces
in the CMakeLists.txt file. https://github.com/ros2/domain_bridge/pull/60/commits/0c05dab08241af7e4c2695a600e323b1eefd1166rmw_connextdds
test dependency to readrmw_connext_cpp
; this package is named differently in Foxy. https://github.com/ros2/domain_bridge/pull/60/commits/0c05dab08241af7e4c2695a600e323b1eefd1166explicit rclcpp::Duration(int64_t ns)
constructor overrclcpp::Duration::from_nanoseconds
. https://github.com/ros2/domain_bridge/pull/60/commits/9f3b66adcaf892c334330152bf3c174bc3c6d0a1rcl_node_options_t
. https://github.com/ros2/domain_bridge/pull/60/commits/925a5e1798f21c53103e87d4f96f09adc1c9f940rmw
types for QoS options class. https://github.com/ros2/domain_bridge/pull/60/commits/699ab3a76559f75a6d8ee30bd40d6951fe32aa2armw_time_t
torclcpp::Duration
. https://github.com/ros2/domain_bridge/pull/60/commits/1562d57950f6bf67a15bc1c42734008783d89a19set_domain_id
functionality by doing the same through thercl
layer. https://github.com/ros2/domain_bridge/pull/60/commits/3272a4800db648d4351d287ce5ec85acf5e72701, https://github.com/ros2/domain_bridge/pull/60/commits/549654aaf6047bb28a474d7ffccdbebf0a9886d5, https://github.com/ros2/domain_bridge/pull/60/commits/eb58092084f524447d3c4424bf692ad0b75f1866TODOs
I'll just list the things that are missing in Foxy for now:
Either backport the node option generating hooks added toMy bad, I started from therclcpp_components::ComponentManager
in https://github.com/ros2/rclcpp/pull/1702 to Foxy - which is a difficult ask because this is most likely an ABI breaking change, or "revert" https://github.com/ros2/domain_bridge/pull/32, but that may have performance implications because (quoting @rebecca-butler)"This would allow the bridge and all other nodes to be run in the same process, ideally reducing latency."
main
branch instead ofgalactic
.rclcpp::*Policy
enum classes and the respective getters. These can be accessed throughrmw/types.h
but I suspect the PR these were introduced in (https://github.com/ros2/rclcpp/pull/1467) can be backported.rcl_node_options_t
, so it's just a deficiency in therclcpp
API (in Foxy). In caserclcpp::InitOptions::set_domain_id
cannot be backported to Foxy, thedomain_id
can be obtained throughget_rcl_node_options
(minus some mutex concerns..). Not sure how to set thedomain_id
though. Refer to https://github.com/ros2/rclcpp/issues/910 and the PRs that fell out of it.rclcpp::Context::get_domain_id
.rclcpp::InitOptions::set_domain_id
.get_rcl_node_options
since that is aconst
function. Not sure how to compensate for this API without backporting at least https://github.com/ros2/rcl/pull/678, and ideally also https://github.com/ros2/rclcpp/pull/1165 - although this one is most likely not an ABI-compatible patch.const
object throughconst_cast
is undefined behavior.rclcpp::Duration::from_nanoseconds
. Use theDuration(rcl_duration_value_t nanoseconds)
constructor instead.Closes https://github.com/ros2/domain_bridge/issues/59.
Signed-off-by: Abrar Rahman Protyasha aprotyas@u.rochester.edu