Closed ghost closed 2 years ago
Where are you building ros1_bridge
? Do you source its install location after building? I was having a very similar issue that was caused by accidentally running the prebuilt ros1_bridge
that came with my ros2 install (and thus only included the default interfaces) rather than the version that was built to include my custom messages.
Steps
I have 2 workspaces.
In the ros2 workspace, I have
cpp_srvcli
andex_interfaces
package. Incpp_srvcli
, I just copyadd_two_ints_client.cpp
andadd_two_ints_server.cpp
from ros2 wiki; Inex_interfaces
, I define a srv namedAddTwoInts.srv
In the ros1 workspace, I have one package
roscpp_kakaka
to which just copyroscpp_tutorials
package fromhttps://github.com/ros/ros_tutorials/tree/noetic-devel/roscpp_tutorials
and change its name. And I use the srv namedTwoInts.srv
What's more, I followed
https://github.com/ros2/ros1_bridge/blob/master/doc/index.rst
and added amy_mapping_rules.yaml
in the packageex_interfaces
. I checked therosservice list
andros2 service list
, the services names are both/add_two_ints
.After I built the ros1_bridge and run
in seperate terminals, the Shell D response
Could you help me? The ros2 client and ros2 server works; And the ros1 client and ros1 server works, too.
Surely, I modified the
add_two_ints_client.cpp" in ros2 package to fit my package name
ex_interfaceinstead of
example_interfaces`.I also run
ros2 run ros1_bridge dynamic_bridge --print-pairs
to check pairs, but there are only these pairs likeI can't find any pair about my package
ex_interfaces
orcpp_srvcli
.I'm a noob and need help QAQ.