lucasw / ros_from_src

Build ros from source without using a PPA in a github action. Probably just copy what archlinux is doing. See also https://github.com/ros-o/ros-o
BSD 3-Clause "New" or "Revised" License
100 stars 16 forks source link

ros2 iron from source on Ubuntu 23.04 #29

Closed lucasw closed 4 months ago

lucasw commented 9 months ago

Use debian colcon (no ppas)

sudo apt install colcon
lucasw commented 9 months ago
mkdir -p ~/ros/ros2_iron/src
cd ~/ros/ros2_iron/src
wget https://raw.githubusercontent.com/ros2/ros2/iron/ros2.repos
vcs import < ros2.repos
sudo apt install libacl1-dev libasio-dev liblttng-ust-dev python3-lark libxaw7-dev
cd ~/ros/ros2_iron
MAKEFLAGS="-j 4" colcon build --symlink-install --executor sequential --event-handlers console_cohesion+ --cmake-args -DCMAKE_VERBOSE_MAKEFILE=ON

or just this if cpu usage isn't a concern:

colcon build --symlink-install 

358 packages to build...

lucasw commented 9 months ago

Lots of these:

--- stderr: ament_copyright                                                                                                                                               
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:146: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---

More than a few packages do git operations in the build steps:

--- stderr: ignition_cmake2_vendor                                                                                                                                                                     
Cloning into 'ignition-cmake2-2.14.0'...
HEAD is now at d9a33bf 🎈 2.14.0 (#287)
---
-- stderr: rti_connext_dds_cmake_module                                                                                                                                                                
CMake Warning at cmake/rti_build_helper.cmake:380 (message):
  no CONNEXTDDS_DIR nor NDDSHOME specified
Call Stack (most recent call first):
  cmake/rti_build_helper.cmake:554 (rti_load_connextddsdir)
  CMakeLists.txt:25 (rti_find_connextpro)
n file included from /usr/include/x86_64-linux-gnu/c++/12/bits/c++allocator.h:33,
                 from /usr/include/c++/12/bits/allocator.h:46,
                 from /usr/include/c++/12/vector:61,
                 from /home/lucasw/ros/ros2_iron/src/eProsima/Fast-DDS/include/fastdds/dds/core/policy/QosPolicies.hpp:23,
                 from /home/lucasw/ros/ros2_iron/src/eProsima/Fast-DDS/include/fastdds/dds/publisher/qos/WriterQos.hpp:23,
                 from /home/lucasw/ros/ros2_iron/src/eProsima/Fast-DDS/include/fastrtps/qos/WriterQos.h:23,
                 from /home/lucasw/ros/ros2_iron/src/eProsima/Fast-DDS/include/fastdds/rtps/builtin/data/WriterProxyData.h:24,
                 from /home/lucasw/ros/ros2_iron/src/eProsima/Fast-DDS/src/cpp/rtps/builtin/data/WriterProxyData.cpp:20:
In member function ‘void std::__new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = long unsigned int; _Args = {const long unsigned int&}; _Tp = long unsigned int]’,
    inlined from ‘static void std::allocator_traits<std::allocator<_Tp1> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = long unsigned int; _Args = {const long unsigned int&}; _Tp = long unsigned int]’ at /usr/include/c++/12/bits/alloc_traits.h:516:17,
    inlined from ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long unsigned int; _Alloc = std::allocator<long unsigned int>]’ at /usr/include/c++/12/bits/stl_vector.h:1281:30,
    inlined from ‘void eprosima::fastdds::dds::DataSharingQosPolicy::add_domain_id(uint64_t)’ at /home/lucasw/ros/ros2_iron/src/eProsima/Fast-DDS/include/fastdds/dds/core/policy/QosPolicies.hpp:3129:34,
    inlined from ‘static bool eprosima::fastdds::dds::QosPoliciesSerializer<QosPolicy>::read_content_from_cdr_message(QosPolicy&, eprosima::fastrtps::rtps::CDRMessage_t*, uint16_t) [with QosPolicy = eprosima::fastdds::dds::DataSharingQosPolicy]’ at /home/lucasw/ros/ros2_iron/src/eProsima/Fast-DDS/src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp:872:33,
    inlined from ‘static bool eprosima::fastdds::dds::QosPoliciesSerializer<QosPolicy>::read_from_cdr_message(QosPolicy&, eprosima::fastrtps::rtps::CDRMessage_t*, uint16_t) [with QosPolicy = eprosima::fastdds::dds::DataSharingQosPolicy]’ at /home/lucasw/ros/ros2_iron/src/eProsima/Fast-DDS/src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp:51:47,
    inlined from ‘eprosima::fastrtps::rtps::WriterProxyData::readFromCDRMessage(eprosima::fastrtps::rtps::CDRMessage_t*, const eprosima::fastrtps::rtps::NetworkFactory&, bool)::<lambda(eprosima::fastrtps::rtps::CDRMessage_t*, const eprosima::fastrtps::ParameterId_t&, uint16_t)>’ at /home/lucasw/ros/ros2_iron/src/eProsima/Fast-DDS/src/cpp/rtps/builtin/data/WriterProxyData.cpp:959:110:
/usr/include/c++/12/bits/new_allocator.h:175:11: warning: ‘domain’ may be used uninitialized [-Wmaybe-uninitialized]
  175 |         { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/lucasw/ros/ros2_iron/src/eProsima/Fast-DDS/src/cpp/rtps/builtin/data/WriterProxyData.cpp:25:
/home/lucasw/ros/ros2_iron/src/eProsima/Fast-DDS/src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp: In function ‘eprosima::fastrtps::rtps::WriterProxyData::readFromCDRMessage(eprosima::fastrtps::rtps::CDRMessage_t*, const eprosima::fastrtps::rtps::NetworkFactory&, bool)::<lambda(eprosima::fastrtps::rtps::CDRMessage_t*, const eprosima::fastrtps::ParameterId_t&, uint16_t)>’:
/home/lucasw/ros/ros2_iron/src/eProsima/Fast-DDS/src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp:870:18: note: ‘domain’ was declared here
  870 |         uint64_t domain;
--- stderr: rcutils                                                                                                                                                               
/usr/bin/ld: warning: trampoline-x86_64-systemv.S.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
Cloning into 'ignition-math6-6.9.2'...
HEAD is now at 23bf73a3 🎈 6.9.2 (#268)
/home/lucasw/ros/ros2_iron/build/ignition_math6_vendor/ignition-math6-6.9.2-prefix/src/ignition-math6-6.9.2-build/lib/python/pythonPYTHON_wrap.cxx: In function ‘PyObject* _wrap_new_PID__SWIG_9(PyObject*, Py_ssize_t, PyObject**)’:
/home/lucasw/ros/ros2_iron/build/ignition_math6_vendor/ignition-math6-6.9.2-prefix/src/ignition-math6-6.9.2-build/lib/python/pythonPYTHON_wrap.cxx:67968:93: warning: implicitly-declared ‘constexpr ignition::math::v6::PID::PID(const ignition::math::v6::PID&)’ is deprecated [-Wdeprecated-copy]
67968 |   result = (ignition::math::PID *)new ignition::math::PID((ignition::math::PID const &)*arg1);
      |                                                                                             ^
In file included from /home/lucasw/ros/ros2_iron/build/ignition_math6_vendor/ignition-math6-6.9.2-prefix/src/ignition-math6-6.9.2-build/lib/python/pythonPYTHON_wrap.cxx:5974:
/home/lucasw/ros/ros2_iron/build/ignition_math6_vendor/ignition-math6-6.9.2-prefix/src/ignition-math6-6.9.2/include/ignition/math/PID.hh:187:20: note: because ‘ignition::math::v6::PID’ has user-provided ‘ignition::math::v6::PID& ignition::math::v6::PID::operator=(const ignition::math::v6::PID&)’
  187 |       public: PID &operator=(const PID &_p);
      |                    ^~~~~~~~
---
--- stderr: rcl_yaml_param_parser                                                                                                                                                                
/usr/bin/ld: warning: trampoline-x86_64-systemv.S.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: warning: trampoline-x86_64-systemv.S.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
---
--- stderr: qt_gui_cpp                                                                                                                                                              
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
lucasw commented 9 months ago

--parallel-workers 4 doesn't mean limit to 4 cpu cores, rclpy looks to be taking many cores

https://robotics.stackexchange.com/questions/97896/colcon-build-number-of-threads

MAKEFLAGS="-j 4" colcon build --symlink-install --executor sequential
MAKEFLAGS="-j 4" colcon build --symlink-install --executor sequential --event-handlers console_cohesion+ --cmake-args -DCMAKE_VERBOSE_MAKEFILE=ON
lucasw commented 9 months ago

Ran into issue building rviz_rendering where it wanted the xaw library, so installed libxaw7-dev and ran colcon build and it failed the same way, had to delete build/rviz_rendering and build again then it worked- it didn't search for the library again, was using cached results.

/usr/bin/ld: cannot find -lXAW_LIBRARY-NOTFOUND: No such file or directory
lucasw commented 9 months ago

ros1_bridge

It doesn't like the debian installed ros1 opencv_apps

CMake Error at cmake/find_ros1_package.cmake:29 (message):
  find_ros1_package() failed to find 'opencv_apps' using pkg_check_modules()
Call Stack (most recent call first):
  CMakeLists.txt:60 (find_ros1_package)
rospack find opencv_apps
/usr/share/opencv_apps

But I can source my ~/catkin_ws/devel/setup.bash first before ros2_iron_overlay/install/local_setup.bash, then it finds opencv_apps (in the same location).

Next it fails on apriltag_ros- but why does it need that- is there a big list of every package with messages that it is capable of bridging?

No it's searching /home/lucasw/install_base_catkin_ws/install/lib which has a leftover apriltag directory, clean that (including ros1_bridge build/install files) and try again (though should make apriltags build later)

lucasw commented 9 months ago

Can skip not-found packages in ros1_bridge:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,8 +57,14 @@ foreach(ros1_message_package ${ros1_message_packages})
   # TODO(karsten1987): This is currently a workaround to work with ROS 2 classloader
   # rather than ROS 1 classloader.
   if(NOT "${ros1_message_package}" STREQUAL "nodelet")
-    find_ros1_package(${ros1_message_package} REQUIRED)
-    list(APPEND prefixed_ros1_message_packages "ros1_${ros1_message_package}")
+    find_ros1_package(${ros1_message_package})  # REQUIRED)
+    message(INFO " msg pkg: ${ros1_message_package} ${ros1_${ros1_message_package}_FOUND}")
+
+    if(NOT ros1_${ros1_message_package}_FOUND)
+      message(WARNING " skipping ${ros1_message_package}")
+    else()
+      list(APPEND prefixed_ros1_message_packages "ros1_${ros1_message_package}")
+    endif()
   endif()
 endforeach()

and it skips all of these

 apriltag_ros
 base_local_planner
 costmap_2d 
 find_object_2d
 frei0r_image
 fuse_models
 image_view2
 jsk_rviz_plugins
 jsk_topic_tools
 laser_assembler
 navfn
 nodelet_rosbag
 opencv_apps
 polled_camera
 robot_localization
 rviz
 spectrogram_paint_ros

But then end up with

CMake Warning at CMakeLists.txt:197 (add_executable):
  Cannot generate a safe runtime search path for target dynamic_bridge
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libmessage_filters.so.1d] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/lucasw/install_base_catkin_ws/install/lib
    runtime library [libroscpp.so.4d] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/lucasw/install_base_catkin_ws/install/lib
    runtime library [libxmlrpcpp.so.3d] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/lucasw/install_base_catkin_ws/install/lib
    runtime library [librosconsole.so.3d] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/lucasw/install_base_catkin_ws/install/lib
    runtime library [librosconsole_log4cxx.so.3d] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/lucasw/install_base_catkin_ws/install/lib
    runtime library [librosconsole_backend_interface.so.3d] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/lucasw/install_base_catkin_ws/install/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  CMakeLists.txt:259 (custom_executable)

and error out with

In file included from /home/lucasw/ros/ros2_iron_overlay/build/ros1_bridge/generated/get_factory.cpp:32:
/home/lucasw/ros/ros2_iron_overlay/build/ros1_bridge/generated/tf2_msgs_factories.hpp:14:10: fatal error: tf2_msgs/msg/tf2_error.hpp: No such file or directory
   14 | #include <tf2_msgs/msg/tf2_error.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
lucasw commented 9 months ago

Using https://github.com/lucasw/ros1_bridge/tree/skip_not_found

Trying again clean while only sourcing install_base_catkin_ws/devel/setup.bash (and not overlaying catkin_ws/devel/setup.bash, which is also using a python venv so maybe that is part of the problem) thensource ros2_iron/install/local_setup.bash` - went for ten minutes but appears to have worked with only warnings (same as above), skipping these:

 apriltag_ros
 base_local_planner
 costmap_2d 
 find_object_2d 
 frei0r_image 
 fuse_models 
 image_view2 
 jsk_rviz_plugins 
 jsk_topic_tools 
 laser_assembler 
 navfn 
 nodelet_rosbag 
 opencv_apps 
 polled_camera 
 robot_localization 
 rviz
lucasw commented 9 months ago
~/ros/ros2_iron_overlay$ ros2 run ros1_bridge dynamic_bridge
failed to create 2to1 bridge for topic '/rosout' with ROS 2 type 'rcl_interfaces/msg/Log' and ROS 1 type 'rosgraph_msgs/Log': No template specialization for the pair
check the list of supported pairs with the `--print-pairs` option

-> https://github.com/ros2/ros1_bridge/issues/391

lucasw commented 9 months ago

The example works, have to specify the topic type if there's no other subscriber, the topics aren't visible to ros2 topic list need to know what they are from the ros1 side:

rosrun rospy_tutorials talker
ros2 topic echo /chatter std_msgs/msg/String
lucasw commented 9 months ago

Need rqt_image_view

Using rolling branch:

CMake Error at CMakeLists.txt:72 (target_link_libraries):
  Target "rqt_image_view" links to:

    cv_bridge::cv_bridge

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

-> vision_opencv -it builds but still get the same error

Still can't get it to compile, there

~/ros/ros2_iron/src/misc/rqt_image_view$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5cba001..287e917 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,8 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
   add_compile_options(-Wall -Wextra -Wpedantic)
 endif()

+find_package(OpenCV REQUIRED COMPONENTS core imgproc)
+
 find_package(rclcpp REQUIRED)
 find_package(qt_gui_cpp REQUIRED)
 find_package(rqt_gui_cpp REQUIRED)
@@ -61,6 +63,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
   "$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")

 target_link_libraries(${PROJECT_NAME} PUBLIC
+  opencv_core
   ${rclcpp_TARGETS}
   ${qt_gui_cpp_TARGETS}
   ${rqt_gui_cpp_TARGETS}
@@ -69,8 +72,8 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
   ${geometry_msgs_TARGETS}
   Qt5::Widgets
 )
-target_link_libraries(${PROJECT_NAME} PRIVATE
-  cv_bridge::cv_bridge)
+# target_link_libraries(${PROJECT_NAME} PRIVATE
+#   cv_bridge::cv_bridge)

 install(
   TARGETS ${PROJECT_NAME}
In file included from /usr/include/cv_bridge/cv_bridge.h:41,
                 from /home/lucasw/ros/ros2_iron/src/misc/rqt_image_view/src/rqt_image_view/image_view.cpp:38:
/usr/include/sensor_msgs/image_encodings.h:47:23: error: conflicting declaration ‘const std::string sensor_msgs::image_encodings::RGB8’
   47 |     const std::string RGB8 = "rgb8";
      |       

This is in the build command:

-isystem /home/lucasw/ros/ros2_iron/install/sensor_msgs/include/sensor_msgs

Everything in vision_opencv builds fine, though maybe none of it depends on cv bridge- no opencv_tests does and it built fine, look at what it is doing in cmake... nope it doesn't use cmake, it's pure python.

~/ros/ros2_iron/src/misc$ vcs export
repositories:
  rqt_image_view:
    type: git
    url: git@github.com:lucasw/rqt_image_view.git
    version: cv-bridge-hpp
  vision_opencv:
    type: git
    url: git@github.com:ros-perception/vision_opencv.git
    version: rolling

-> https://github.com/ros-visualization/rqt_image_view/pull/80

lucasw commented 9 months ago

Going to uninstall for now, need to check if install_base_catkin_ws still builds after this:

sudo apt remove libsensor-msgs-dev

Need to bring these in:

repositories:
  common_msgs:
    type: git
    url: git@github.com:ros/common_msgs.git
    version: noetic-devel
  geometry:
    type: git
    url: git@github.com:ros/geometry.git
    version: noetic-devel
  laser_geometry:
    type: git
    url: git@github.com:ros-o/laser_geometry.git
    version: obese-devel
  navigation_msgs:
    type: git
    url: git@github.com:ros-planning/navigation_msgs.git
    version: ros1
  pcl_msgs:
    type: git
    url: git@github.com:ros-perception/pcl_msgs.git
    version: noetic-devel
  perception_pcl:
    type: git
    url: git@github.com:ros-o/perception_pcl.git
    version: obese-devel
  vision_opencv:
    type: git
    url: git@github.com:ros-perception/vision_opencv.git
    version: noetic
lucasw commented 9 months ago

Now can build rqt_image_view (undid modifications to CMakeLists.txt)

In file included from /home/lucasw/ros/ros2_iron/src/misc/rqt_image_view/src/rqt_image_view/image_view.cpp:38:
/home/lucasw/ros/ros2_iron/install/cv_bridge/include/cv_bridge/cv_bridge/cv_bridge.h:42:2: warning: #warning This header is obsolete, please include cv_bridge/cv_bridge.hpp instead [-Wcpp]
   42 | #warning This header is obsolete, please include cv_bridge/cv_bridge.hpp instead
      |  ^~~~~~~
---
lucasw commented 9 months ago

Try out rviz

rviz2  # works
ros2 run rviz2 rviz2

It outputs a lot when frame_id isn't set:

[INFO] [1695948398.611822550] [rviz]: Message Filter dropping message: frame '' at time 1695948398.563 for reason 'the frame id of the message is empty'
...
lucasw commented 9 months ago

rclpy Duration doesn't have a to_sec(), the equivalent is my_duration.nanoseconds / 1e9

lucasw commented 9 months ago

Moving ros2_iron from ~/tmp to ~/ros

recursive serach and replace lucasw/tmp/ to lucasw/ros/ in build/

find . -type f -name "*" -exec sed -i'' -e 's/lucasw\/tmp/lucasw\/ros/g' {} +

-> it rebuilt everything anyhow, should have just wiped build and install

lucasw commented 9 months ago

After full build didn't see an issue with /usr/include/sensor_msgs/image_encodings.h on a different system than the above- so didn't need to remove libsensor-msgs-dev

lucasw commented 9 months ago

Need to add --cmake-args -DCMAKE_BUILD_TYPE=Release to colcon build https://github.com/colcon/colcon-cmake/issues/96

Also can put in colcon defaults.yaml as in https://gist.github.com/christophebedard/3814c051231761b1eb0df1242f3fe0d8 how to tell if those options were actually used?

-> errors will be seen right after colcon build

WARNING:colcon.colcon_defaults.argument_parser.defaults:Default value 'cmake-args' for parser 'build' should be a list, not: -DCMAKE_BUILD_TYPE=Release

If it does work then it is silent

Think this works:

{
    "build": {
        "symlink-install": true,
        "cmake-args": [
          "-DCMAKE_BUILD_TYPE=Release",
        ],
    }
}

->

export COLCON_DEFAULTS_FILE=$HOME/ros/colcon_defaults.yaml

also limit cpu cores:

export MAKEFLAGS="-j 4" colcon build
kennyS99 commented 9 months ago
~/ros/ros2_iron_overlay$ ros2 run ros1_bridge dynamic_bridge
failed to create 2to1 bridge for topic '/rosout' with ROS 2 type 'rcl_interfaces/msg/Log' and ROS 1 type 'rosgraph_msgs/Log': No template specialization for the pair
check the list of supported pairs with the `--print-pairs` option

-> ros2/ros1_bridge#391

Hey Lucas, This issue still exists in the ros2 rolling version. Is there any solution you know to solve it? I appreciate it your replay and attention.

lucasw commented 9 months ago

Hey Lucas, This issue still exists in the ros2 rolling version. Is there any solution you know to solve it? I appreciate it your replay and attention.

I didn't find a solution, just ignored the error- maybe https://github.com/ros2/ros1_bridge/issues/391#issuecomment-1472665701 is a good start- is it possible to go back to https://github.com/ros2/ros1_bridge/commit/81f8b08671c8d161a0f0482bae4580d4d01e69c9 or are following commits necessary for it to work?

kennyS99 commented 9 months ago

Hey Lucas, This issue still exists in the ros2 rolling version. Is there any solution you know to solve it? I appreciate it your replay and attention.

I didn't find a solution, just ignored the error- maybe ros2/ros1_bridge#391 (comment) is a good start- is it possible to go back to ros2/ros1_bridge@81f8b08 or are following commits necessary for it to work?

Firstly, I very appreciate your quick replay. after a couple of attempts of commit 81f8b08671c8d161a0f0482bae4580d4d01e69c9, I found it could not solve my problem. but commit b9f1739fd84fc877a8ec6e5c416b65aa2d782f89 did solve the /rosout topics bridge very well.

lucasw commented 9 months ago

Trying out ros2/ros1_bridge@81f8b08 - it builds okay without the need to skip packages

roscore
rostopic pub /rosout rosgraph_msgs/Log "{level: 0, name: 'foo', msg: 'bar123'}" -r 1
...
ros2 run ros1_bridge dynamic_bridge
created 1to2 bridge for topic '/rosout' with ROS 1 type 'rosgraph_msgs/Log' and ROS 2 type 'rcl_interfaces/msg/Log'
created 2to1 bridge for topic '/rosout' with ROS 2 type 'rcl_interfaces/msg/Log' and ROS 1 type 'rosgraph_msgs/Log'
[WARN] [1696773603.395194390] [ros_bridge]: New subscription discovered on topic '/rosout', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: DURABILITY_QOS_POLICY
[INFO] [1696773603.407521100] [ros_bridge]: Passing message from ROS 2 rcl_interfaces/msg/Log to ROS 1 rosgraph_msgs/Log (showing msg only once per type)
[INFO] [1696773604.067792874] [ros_bridge]: Passing message from ROS 1 rosgraph_msgs/Log to ROS 2 rcl_interfaces/msg/Log (showing msg only once per type)
ros2 topic echo /rosout
[WARN] [1696773674.406063393] [_ros2cli_103516]: New publisher discovered on topic '/rosout', offering incompatible QoS. No messages will be received from it. Last incompatible policy: DURABILITY
stamp:
  sec: 1696773674
  nanosec: 393526055
level: 30
name: ros_bridge
msg: New subscription discovered on topic '/rosout', requesting incompatible QoS. No messages will be sent to it. Last incompatible p...
file: /home/lucasw/ros/ros2_iron/src/ros2/rclcpp/rclcpp/src/rclcpp/publisher_base.cpp
function: default_incompatible_qos_callback
line: 332
---

Trying https://github.com/ros2/ros1_bridge/commit/b9f1739fd84fc877a8ec6e5c416b65aa2d782f89 next (but ros1_bridge takes a long time to compile... 9 minutes on 4 cores):

ros2 topic info /rosout --verbose
Type: rcl_interfaces/msg/Log

Publisher count: 4

Node name: _ros2cli_daemon_0_79a8277a4f9e49f1b5d5cdf60c58349a
Node namespace: /
Topic type: rcl_interfaces/msg/Log
Topic type hash: RIHS01_e28ce254ca8abc06abf92773b74602cdbf116ed34fbaf294fb9f81da9f318eac
Endpoint type: PUBLISHER
GID: 01.0f.15.f2.77.8f.7b.a2.00.00.01.00.00.00.03.03
QoS profile:
  Reliability: RELIABLE
  History (Depth): UNKNOWN
  Durability: TRANSIENT_LOCAL
  Lifespan: 10000000000 nanoseconds
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

Node name: ros_bridge
Node namespace: /
Topic type: rcl_interfaces/msg/Log
Topic type hash: RIHS01_e28ce254ca8abc06abf92773b74602cdbf116ed34fbaf294fb9f81da9f318eac
Endpoint type: PUBLISHER
GID: 01.0f.15.f2.b4.aa.02.1a.00.00.00.00.00.00.03.03
QoS profile:
  Reliability: RELIABLE
  History (Depth): UNKNOWN
  Durability: TRANSIENT_LOCAL
  Lifespan: 10000000000 nanoseconds
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite
ros2 topic echo /rosout --qos-durability=volatile
stamp:
  sec: 0
  nanosec: 0
level: 0
name: foo
msg: bar123
file: ''
function: ''
line: 0
---

-> works :heavy_check_mark:

also the later version works, next try 2381bf4 - that doesn't work, matching the original comment in the other thread

kennyS99 commented 9 months ago

Trying out ros2/ros1_bridge@81f8b08 - it builds okay without the need to skip packages

roscore
rostopic pub /rosout rosgraph_msgs/Log "{level: 0, name: 'foo', msg: 'bar123'}" -r 1
...
ros2 run ros1_bridge dynamic_bridge
created 1to2 bridge for topic '/rosout' with ROS 1 type 'rosgraph_msgs/Log' and ROS 2 type 'rcl_interfaces/msg/Log'
created 2to1 bridge for topic '/rosout' with ROS 2 type 'rcl_interfaces/msg/Log' and ROS 1 type 'rosgraph_msgs/Log'
[WARN] [1696773603.395194390] [ros_bridge]: New subscription discovered on topic '/rosout', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: DURABILITY_QOS_POLICY
[INFO] [1696773603.407521100] [ros_bridge]: Passing message from ROS 2 rcl_interfaces/msg/Log to ROS 1 rosgraph_msgs/Log (showing msg only once per type)
[INFO] [1696773604.067792874] [ros_bridge]: Passing message from ROS 1 rosgraph_msgs/Log to ROS 2 rcl_interfaces/msg/Log (showing msg only once per type)
ros2 topic echo /rosout
[WARN] [1696773674.406063393] [_ros2cli_103516]: New publisher discovered on topic '/rosout', offering incompatible QoS. No messages will be received from it. Last incompatible policy: DURABILITY
stamp:
  sec: 1696773674
  nanosec: 393526055
level: 30
name: ros_bridge
msg: New subscription discovered on topic '/rosout', requesting incompatible QoS. No messages will be sent to it. Last incompatible p...
file: /home/lucasw/ros/ros2_iron/src/ros2/rclcpp/rclcpp/src/rclcpp/publisher_base.cpp
function: default_incompatible_qos_callback
line: 332
---

Trying ros2/ros1_bridge@b9f1739 next (but ros1_bridge takes a long time to compile...):

Thx for your reply. Yes, I used this commit today, and it's working well with my env. Best regards

lucasw commented 8 months ago

ros2 msg list (equivalent of rosmsg list)

ros2 interface list
lucasw commented 6 months ago
sudo apt install liblttng-ctl-dev

ros2_tracing