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

g.bardaro's profile - activity

2022-10-19 13:55:43 -0500 marked best answer How to remap topic in a ROS2 launch file?

Hi everyone,

I am setting up a navigation2 launch file.

I have used this one as a reference, and everything seems to work.

However, I need to remap the /cmd_vel topic. I am not sure what is the syntax to do so in a top-level launch file to have it propagated to a nested launch file.

Thanks for the help

2022-02-23 15:32:03 -0500 received badge  Famous Question (source)
2022-01-31 13:15:58 -0500 received badge  Great Question (source)
2021-10-18 11:35:36 -0500 received badge  Good Question (source)
2021-06-18 05:08:28 -0500 received badge  Famous Question (source)
2021-06-17 01:10:04 -0500 received badge  Notable Question (source)
2021-06-17 01:10:04 -0500 received badge  Popular Question (source)
2021-06-11 08:25:35 -0500 asked a question ros1_bridge extremely slow when passing images

ros1_bridge extremely slow when passing images Hello everyone, I am using ros1_bridge to convert image messages coming

2021-05-07 13:27:51 -0500 received badge  Notable Question (source)
2021-04-27 07:54:22 -0500 received badge  Famous Question (source)
2021-04-24 18:35:28 -0500 received badge  Popular Question (source)
2021-04-22 12:55:03 -0500 received badge  Favorite Question (source)
2021-04-22 11:09:15 -0500 received badge  Nice Question (source)
2021-04-22 10:49:02 -0500 received badge  Student (source)
2021-04-22 05:23:05 -0500 asked a question How to remap topic in a ROS2 launch file?

How to remap topic in a ROS2 launch file? Hi everyone, I am setting up a navigation2 launch file. I have used this one

2021-04-03 09:54:26 -0500 received badge  Self-Learner (source)
2021-04-03 09:35:36 -0500 received badge  Notable Question (source)
2021-04-03 09:35:36 -0500 received badge  Famous Question (source)
2021-02-25 05:15:38 -0500 received badge  Notable Question (source)
2021-02-25 05:15:38 -0500 received badge  Popular Question (source)
2021-02-03 11:32:37 -0500 edited answer How to echo messages published on a particular topic by a node?

It is not clear from your description, but I assume you are talking about a situation where multiple nodes are publishin

2021-02-03 11:21:06 -0500 answered a question How to echo messages published on a particular topic by a node?

It is not clear from your description, but I assume you are talking about a situation where multiple nodes are publishin

2021-02-03 11:21:06 -0500 received badge  Rapid Responder (source)
2021-02-02 10:52:06 -0500 commented answer message_filters in C++ not subscribing to topics when implemented in a class

Of course! Thanks a lot!

2021-02-02 10:49:42 -0500 marked best answer message_filters in C++ not subscribing to topics when implemented in a class

Hi all, I am having some issues with message filters, but I am not sure if I am doing something wrong or if there is a bug somewhere.

After some difficulties, I decided to implement a couple of minimal examples to describe the problem.

So, the toy example is very simple, I have a publisher node that publishes on two topics (topic1 and topic2) a custom-defined IntStamped message. They have exactly the same timestamp, so there are no issues in the generated messages.

Then, I have implemented two C++ nodes using message_filters, the first one wraps everything in a class, while the second doesn't.

Here are the nodes.

Whit the classes:

#include "message_filters/subscriber.h"
#include "message_filters/time_synchronizer.h"
#include "boundingbox_msg/msg/int_stamped.hpp"

using namespace  message_filters;

using std::placeholders::_1;
using std::placeholders::_2;

class MinimalSyncClass : public rclcpp::Node {
public:
    MinimalSyncClass() : Node("minimal_sync_class") {
        Subscriber<boundingbox_msg::msg::IntStamped> sub1(this, "topic1");
        Subscriber<boundingbox_msg::msg::IntStamped> sub2(this, "topic2");
        TimeSynchronizer<boundingbox_msg::msg::IntStamped, boundingbox_msg::msg::IntStamped> sync(
                sub1,
                sub2,
                10);
        sync.registerCallback(std::bind(&MinimalSyncClass::callback, this,
                                        std::placeholders::_1,
                                        std::placeholders::_2));
        RCLCPP_INFO_STREAM(this->get_logger(), "Init complete");
    }
private:
    void callback(
            const boundingbox_msg::msg::IntStamped::ConstSharedPtr& msg1,
            const boundingbox_msg::msg::IntStamped::ConstSharedPtr& msg2) const {
        RCLCPP_INFO_STREAM(this->get_logger(), "Result: "<<msg1->value + msg2->value );
    }
};


int main(int argc, char *argv[]) {
    rclcpp::init(argc, argv);
    rclcpp::spin(std::make_shared<MinimalSyncClass>());
    rclcpp::shutdown();
    return 0;
}

And this one without the class:

#include "message_filters/subscriber.h"
#include "message_filters/time_synchronizer.h"
#include "boundingbox_msg/msg/int_stamped.hpp"

using namespace  message_filters;

using std::placeholders::_1;
using std::placeholders::_2;

void callback(
        const boundingbox_msg::msg::IntStamped::ConstSharedPtr& msg1,
        const boundingbox_msg::msg::IntStamped::ConstSharedPtr& msg2) {
    RCLCPP_INFO_STREAM(rclcpp::get_logger("minimal_sync"), "Result: "<<msg1->value + msg2->value );
}

int main(int argc, char** argv)
{
    rclcpp::init(argc, argv);
    auto nh = std::make_shared<rclcpp::Node>("minimal_sync");
    Subscriber<boundingbox_msg::msg::IntStamped> sub1(nh.get(), "topic1");
    Subscriber<boundingbox_msg::msg::IntStamped> sub2(nh.get(), "topic2");
    TimeSynchronizer<
            boundingbox_msg::msg::IntStamped,
            boundingbox_msg::msg::IntStamped> sync(sub1, sub2, 10);
    sync.registerCallback(std::bind(&callback, _1, _2));
    RCLCPP_INFO(rclcpp::get_logger("minimal_sync"), "Init" );
    rclcpp::spin(nh);
    return 0;
}

If I run all the three nodes together, this is the result in rqt_graph:

image description

As you can see, the one without the class is connected to the topics and it is working properly, while the other with the class it's completely disconnected.

I am honestly lost, and can't figure out where the problem is.

2021-02-02 10:13:08 -0500 asked a question message_filters in C++ not subscribing to topics when implemented in a class

message_filters in C++ not subscribing to topics when implemented in a class Hi all, I am having some issues with messag

2021-01-27 09:41:08 -0500 received badge  Popular Question (source)
2021-01-27 08:30:55 -0500 marked best answer PointCloud2 visualisation in rviz2

EDIT:

Apparently the problem is not about visualisation or rviz. I tried to implement a minimal subscriber that receives point cloud messages and just print a notification and it doesn't work. The callback is never called. However, if I use ros2 echo I can subscribe and receive messages. I can confirm that the nodes are connected in the graph, so it is not a topic name issue.

image description

Am I missing something?

END EDIT

Hi all,

I am finally migrating from ROS1 to ROS2 and, currently, I am trying to implement nodes to process depth images and point clouds.

I have a node that reads depth images from a folder and publishes them as messages paired with the corresponding camera calibration message. These depth messages are feed to depth_image_proc::PointCloudXyzNode, which correctly publish them as point clouds.

This is the output I get from echoing the topic:

header:
  stamp:
    sec: 1611675769
    nanosec: 545850714
  frame_id: camera_depth_optical_frame
height: 480
width: 640
fields: '<sequence type: sensor_msgs/msg/PointField, length: 3>'
is_bigendian: false
point_step: 16
row_step: 10240
data: '<sequence type: uint8, length: 4915200>'
is_dense: false

From here the message seems fine and well-formed. However, when I try to see in rviz2 I get nothing. At first I thought it was a problem with tf, so I tried to publish a dummy transformation between map and camera_depth_optical_frame, but nothing appears.

This is what I get in rviz2:

image description

No matter what it keeps saying: "Showing [0] points from [0] messages"

Any idea of what could be the problem?

2021-01-27 08:30:45 -0500 answered a question PointCloud2 visualisation in rviz2

To expand on the solution provided in the previous answer. depth_image_proc::PointCloudXyzNode publisher has a "sensor

2021-01-27 08:30:45 -0500 received badge  Rapid Responder (source)
2021-01-27 08:10:51 -0500 commented answer PointCloud2 visualisation in rviz2

Sorry, I answered your comment saying that this change did nothing, but this is actually the solution. I was in a rush a

2021-01-27 06:29:47 -0500 received badge  Enthusiast
2021-01-26 11:55:23 -0500 edited question PointCloud2 visualisation in rviz2

PointCloud2 visualisation in rviz2 EDIT: Apparently the problem is not about visualisation or rviz. I tried to implemen

2021-01-26 09:58:57 -0500 edited question PointCloud2 visualisation in rviz2

PointCloud2 visualisation in rviz2 Hi all, I am finally migrating from ROS1 to ROS2 and, currently, I am trying to impl

2021-01-26 09:58:57 -0500 received badge  Editor (source)
2021-01-26 09:56:39 -0500 edited question PointCloud2 visualisation in rviz2

PointCloud2 visualisation in rviz2 Hi all, I am finally migrating from ROS1 to ROS2 and, currently, I am trying to impl

2021-01-26 09:54:28 -0500 asked a question PointCloud2 visualisation in rviz2

PointCloud2 visualisation in rviz2 Hi all, I am finally migrating from ROS1 to ROS2 and, currently, I am trying to impl

2019-11-20 09:31:11 -0500 received badge  Notable Question (source)
2019-11-18 04:44:33 -0500 received badge  Popular Question (source)
2019-11-14 11:12:33 -0500 asked a question tf2 problem with move_base plugin

tf2 problem with move_base plugin Hi all, I implemented a local planner for move_base using pluginlib. It was working f

2019-03-01 16:36:29 -0500 received badge  Nice Answer (source)
2019-03-01 16:36:22 -0500 marked best answer How to check for free cells in a line in the costmap?

Hello, What I want to do is something similar to a raycast. From a specific position draw a line and get the list of all the free cells in that line. The line has a maximum length, but it has to stop if it reach an obstacle. Is there an existing API for that? Or I need to implement it myself?

Thanks!

2018-08-12 19:31:57 -0500 received badge  Famous Question (source)
2018-08-10 22:47:19 -0500 received badge  Self-Learner (source)
2018-08-10 22:47:19 -0500 received badge  Teacher (source)
2018-08-10 12:30:06 -0500 received badge  Notable Question (source)