ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Christian Rauch's profile - activity

2024-02-19 09:13:30 -0500 received badge  Famous Question (source)
2024-02-19 09:13:30 -0500 received badge  Popular Question (source)
2024-02-19 09:13:30 -0500 received badge  Notable Question (source)
2023-08-03 02:53:35 -0500 commented answer rclpy.Subscription getting the number of connections

This is providing the number of subscriptions for a rclpy.publisher.Publisher and not the number of publishers for a rcl

2023-04-13 04:03:49 -0500 marked best answer link composable node into standalone executable

I created a composable node that I want to link into a standalone executable for easier debugging with different parameters. The idea is that the library with the composable node is linked to an executable that behaves as if this would be a standalone node.

Using the launch system will involve other processes and makes debugging via gdb more difficult. Using the component manager for debugging a single component is quite tedious as you have to start the component manager with gdb and load the component manually.

One alternative is the dlopen_composition executable from the composition package, which dynamically loads the library with the component node, instantiates and runs it: ros2 run composition dlopen_composition <workspace>_ws/install/<package>/lib/lib<node>.so. However, the dlopen_composition does not allow to pass configuration parameters like --ros-args --params-file.

I found a node template node_main.cpp.inat https://github.com/ros2/rclcpp/blob/f.... It looks as if this is doing the same as the dlopen_composition just with a hardcoded library. Can this be used in some way to create a standalone executable from a single composable node?

I do not want to use the header to specifically link or compile the node's source code into the main executable. I strongly prefer to use the standard node factories for this.

2023-04-07 03:12:20 -0500 received badge  Notable Question (source)
2023-02-06 13:27:38 -0500 received badge  Famous Question (source)
2023-01-30 22:01:25 -0500 received badge  Famous Question (source)
2023-01-11 10:04:03 -0500 asked a question change QoS settings via YAML launch file

change QoS settings via YAML launch file I would like to change the QoS settings of a topic via a YAML launch file. I c

2022-10-28 04:46:42 -0500 received badge  Good Answer (source)
2022-10-14 15:53:29 -0500 received badge  Notable Question (source)
2022-09-30 02:46:55 -0500 received badge  Good Question (source)
2022-09-16 08:44:32 -0500 commented answer rospack cannot find pure CMake package

How can I create this in $ROS_PACKAGE_PATH? This points to a non-user-writeable location /opt/ros/noetic/share. You can

2022-09-16 08:35:21 -0500 received badge  Rapid Responder (source)
2022-09-16 08:35:21 -0500 answered a question ROS: how can i relife my self from sourcing every work space i create ?

You can source your workspaces in your bashrc (http://wiki.ros.org/noetic/Installation/Ubuntu#noetic.2FInstallation.2FDe

2022-09-04 10:43:47 -0500 received badge  Nice Question (source)
2022-09-04 10:43:36 -0500 received badge  Nice Answer (source)
2022-09-04 10:43:26 -0500 received badge  Notable Question (source)
2022-07-13 18:31:05 -0500 received badge  Nice Answer (source)
2022-06-13 01:59:34 -0500 received badge  Notable Question (source)
2022-06-12 23:42:37 -0500 received badge  Popular Question (source)
2022-03-27 14:38:07 -0500 received badge  Popular Question (source)
2022-03-25 16:20:40 -0500 edited question access parameter that has been declared but not overridden

get_parameter I am trying to declare a parameter and read its value from the command line (-p <parameter>:=<val

2022-03-25 16:19:42 -0500 asked a question access parameter that has been declared but not overridden

get_parameter I am trying to declare a parameter and read its value from the command line (-p <parameter>:=<val

2022-03-25 16:19:14 -0500 asked a question access parameter that has been declared but not overridden

access parameter that has been declared but not overridden I am trying to declare a parameter and read its value from th

2022-02-21 03:17:03 -0500 received badge  Popular Question (source)
2022-02-20 09:35:58 -0500 commented answer How are the "repos" yaml files generated?

Thanks. While this certainly can reduce the number of downloaded source packages, I am still having trouble somehow repl

2022-02-20 09:35:35 -0500 commented answer How are the "repos" yaml files generated?

Thanks. While this certainly can reduce the number of downloaded source packages, I am still having trouble somehow repl

2022-02-20 09:22:22 -0500 marked best answer How are the "repos" yaml files generated?

The "building ROS2 from source" instructions at https://docs.ros.org/en/foxy/Installa... use a "repos" file in yaml format: https://raw.githubusercontent.com/ros....

How is this file generated?

In ROS1, this kind of file was generated with the rosinstall_generatortool (http://wiki.ros.org/Installation/Sour...). Is there something similar for ROS2?

I am asking because I would like to build ROS2 from source with fewer irrelevant packages (e.g. without any of ros-visualization or without ros2/rviz). The only workarounds to prevent building irrelevant packages are 1) removing packages from the repos file manually, 2) deleting source folders after the complete checkout, or 3) by placing COLCON_IGNORE files.

But there surely must be a better way by just specifying the packages of interest and generating the "repos" file programmatically.

2022-02-19 13:46:55 -0500 asked a question How are the "repos" yaml files generated?

How are the "repos" yaml files generated? The "building ROS2 from source" instructions at https://docs.ros.org/en/foxy/I

2022-02-01 14:54:05 -0500 asked a question rospack cannot find pure CMake package

rospack cannot find pure CMake package I am trying to use rospack find to get the path to a "pure cmake" (<build_type

2022-02-01 14:52:58 -0500 asked a question rospack cannot find pure CMake package

rospack cannot find pure CMake package I am trying to use rospack find to get the path to a "pure cmake" (<build_type

2021-12-15 03:50:31 -0500 received badge  Popular Question (source)
2021-11-28 12:40:45 -0500 received badge  Self-Learner (source)
2021-11-26 19:35:14 -0500 answered a question link composable node into standalone executable

I found that, besides rclcpp_components_register_nodes which is heavily used in the node composition tutorial, there is

2021-11-21 11:12:12 -0500 edited question link composable node into standalone executable

link composable node into standalone executable I created a composable node that I want to link into a standalone execut

2021-11-21 10:54:51 -0500 asked a question link composable node into standalone executable

link composable node into standalone executable I created a composable node that I want to link into a standalone execut

2021-11-21 10:53:17 -0500 asked a question link composable node into standalone executable

link composable node into standalone executable I created a composable node that I want to link into a standalone execut

2021-05-06 14:08:06 -0500 received badge  Nice Answer (source)
2021-02-01 22:46:24 -0500 received badge  Famous Question (source)
2020-12-18 16:42:43 -0500 marked best answer declare nested parameter

How do I declare nested variables or lists of key value pairs in ROS2 dashing?

E.g for a yaml structure like

tag_lists:
    base: 9
    object: 14

tag_lists is the known parameter name which contains a list of mappings from strings ("base", "object") to integers (9, 14).

I used to read these nested structures by:

static const std::string tag_list_prefix = "tag_lists";
auto parameters_and_prefixes = list_parameters({tag_list_prefix}, 10);
for (const std::string &name : parameters_and_prefixes.names) {
    const int id = get_parameter(name).get_value<int>();
    tracked_tags[id] = name.substr(tag_list_prefix.size()+1, name.size());
}

I.e. the parameter tag_lists is a namespace with optional sub-parameters that are determined at runtime.

And how would I declare a parameter like:

tag_lists:
    base:
        id: 9
        size: 0.1
    object:
        id: 14
        size: 0.2

that maps from strings ("base", "object") to a list of known parameters ("id", "size")?

2020-10-30 03:42:23 -0500 marked best answer rosdep get list of packages for dependencies

tl;dr: How do I get the list of packages that would be installed by rosdep install without actually installing them?

I want to create a rootfs that can be used to (cross-)compile ROS2. Instead of setting up the ROS repo and running rosdep within the rootfs, I want to gather the dependencies as a list of deb packages outside of the rootfs and only install the list of deb packages that are returned by rosdep. I.e. I do not want to run rosdep install inside the rootfs, but rather want it to return the list of packages it would install and use this list in apt install <list>

Running:

rosdep keys --from-path src --ignore-packages-from-source --os debian:stretch --rosdistro=crystal

seems to include dependencies that are part of the workspace, although --ignore-packages-from-source is provided. E.g. in a ROS2 base workspace from https://raw.githubusercontent.com/ros... , rosdep keys will provide a list that contains rclcpp, rclpy, launch, std_msgs. Hence, piping this into rosdep resolve:

rosdep keys --from-path src -i --os debian:stretch --rosdistro=crystal | xargs rosdep resolve

will not provide the correct list because of ERROR: no rosdep rule for 'std_msgs'

2020-09-07 19:09:10 -0500 marked best answer TransformBroadcaster as member of ROS2 Node

What is the proper way to create a tf2_ros::TransformBroadcaster inside a rclcpp::Node?

I am trying to create a TransformBroadcaster as a member of a ROS2 node, i.e. constructing from this. So far, I am constructing the ROS2 node member tf_broadcaster from a shared pointer to this:

MyNode::MyNode() : Node("my_node", "node_namespace", true) {
    // in header: std::unique_ptr<tf2_ros::TransformBroadcaster> tf_broadcaster;
    tf_broadcaster = std::make_unique<tf2_ros::TransformBroadcaster>(rclcpp::Node::SharedPtr(this));
}

This seems to work in general, e.g. I can publish my transforms. However, I get a double free corruption error when the node is deconstructed, because the node is deconstructed a second time when shared_ptr goes out of scope.

Neither this->shared_from_this() (error at construction: terminate called after throwing an instance of 'std::bad_weak_ptr') nor std::shared_ptr<rclcpp::Node>(this) (error at deconstruction: free(): invalid pointer) allow me to create a shared pointer of this.

Wouldn't it be easier, if the rclcpp::Node would inherit the transformer methods from a TransformBroadcaster class instead of instantiating it manually? E.g. class MyNode : public rclcpp::Node, tf2_ros::TransformBroadcaster {} and then just call this->sendTransform(tf);.