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

alsora's profile - activity

2023-08-07 00:19:14 -0500 received badge  Favorite Question (source)
2023-04-26 12:43:58 -0500 received badge  Nice Answer (source)
2022-12-27 19:32:46 -0500 received badge  Nice Question (source)
2022-12-20 17:22:36 -0500 received badge  Good Question (source)
2022-12-16 08:38:48 -0500 received badge  Good Question (source)
2022-11-17 18:20:39 -0500 answered a question irobot create 3 ros2 humble

FYI: there's a beta release for Create 3 with ROS 2 Humble: https://iroboteducation.github.io/create3_docs/releases/h_0_

2022-11-17 18:20:39 -0500 received badge  Rapid Responder (source)
2022-11-04 15:32:15 -0500 received badge  Nice Answer (source)
2022-06-14 06:00:16 -0500 received badge  Nice Question (source)
2022-05-19 03:40:08 -0500 received badge  Nice Question (source)
2022-02-09 02:18:20 -0500 marked best answer ros2 add arguments to callback

Hi,

I am trying to add an argument to a ROS2 subscriber callback.

The main objective was to print the name of the topic from inside the callback, so I tried to follow this ROS1 example, but it's not working.

These are the relevant parts of my code

Creation of the subscriber

rclcpp::Subscription<std_msgs::msg::Header>::SharedPtr subscriber =  this->create_subscription<std_msgs::msg::Header>(
  topic_name, 
  std::bind(&MultiNode::topic_callback, this, std::placeholders::_1, topic_name));

Callback implementation

void MultiNode::topic_callback(const std_msgs::msg::Header::SharedPtr msg, std::string topic_name)
{
    std::cout<< topic_name<<std::endl;
}

I get a very long sequence of errors which boils down to

error: no matching function for call to ‘rclcpp::AnySubscriptionCallback<std_msgs::msg::Header_<std::allocator<void> >, std::allocator<void> >::set(std::_Bind<std::_Mem_fn<void (MultiNode::*)(std::shared_ptr<std_msgs::msg::Header_<std::allocator<void> > >, std::__cxx11::basic_string<char>)>(MultiNode*, std::_Placeholder<1>, std::__cxx11::basic_string<char>)>)’
   any_subscription_callback.set(std::forward<CallbackT>(callback));
2022-02-02 10:38:27 -0500 received badge  Good Answer (source)
2022-01-27 06:38:31 -0500 received badge  Famous Question (source)
2021-12-17 03:13:11 -0500 received badge  Favorite Question (source)
2021-11-17 05:24:56 -0500 received badge  Nice Question (source)
2021-10-24 02:39:36 -0500 received badge  Nice Question (source)
2021-08-25 08:18:04 -0500 marked best answer ROS2: rviz in docker container

Hi,

I'm trying to use Rviz2 from within a Docker container.

I'm working on top of this Docker image

FROM osrf/ros2:bouncy-desktop

This is my run script

#!/bin/bash

XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth

touch $XAUTH

xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -

docker run -it --rm \
 -e XAUTHORITY=${XAUTH} \
 -e DISPLAY=$DISPLAY \
 -e QT_GRAPHICSSYSTEM=native \
 -v $XSOCK:$XSOCK:rw \
 -v $XAUTH:$XAUTH:rw \
 ros2_docker \
 bash

Everything works fine, but then I needed to make the Docker container communicate with other machines on the host network. I accomplished that by adding the following option to docker run --net=host \

This solves the connectivity issue, but has the side effect of making rviz not working anymore. If I try to run rviz, I only get the following error.

 ros2 run rviz2 rviz2

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
dbus[1041]: The last reference on a connection was dropped without closing the connection. This is a bug in an application. See dbus_connection_unref() documentation for details.
Most likely, the application was supposed to call dbus_connection_close(), since this is a private connection.
  D-Bus not built with -rdynamic so unable to print a backtrace

Any idea about how to fix this? Thanks

2021-08-15 02:26:45 -0500 received badge  Nice Answer (source)
2021-07-31 23:27:15 -0500 received badge  Good Answer (source)
2021-07-22 09:13:42 -0500 asked a question Differences between RMW implementations and their use of typesupport libraries

Differences between RMW implementations and their use of typesupport libraries Hi, I was playing with a ROS 2 applicat

2021-06-30 03:49:42 -0500 received badge  Stellar Question (source)
2021-06-16 18:36:44 -0500 received badge  Good Answer (source)
2021-06-16 08:39:41 -0500 received badge  Nice Answer (source)
2021-06-01 10:24:51 -0500 received badge  Famous Question (source)
2021-05-26 23:29:55 -0500 marked best answer ros2 commandline service call

What's the correct syntax for performing a service call from the command line in ROS2 ?

Consider the following service, defined in example_interfaces package

AddTwoInts.srv

int a
int b
---
int c

Assuming that the server is called "add_two_ints"

I managed to pass one argument to the service call in the following way

$ ros2 service call /add_two_ints example_interfaces/AddTwoInts "a: '1'"        
requester: making request: example_interfaces.srv.AddTwoInts_Request(a=1, b=0)

How to pass also the second argument ?

These are not working

$ ros2 service call /add_two_ints example_interfaces/AddTwoInts "a: '1'b:'2'"
$ ros2 service call /add_two_ints example_interfaces/AddTwoInts "a: '1' b:'2'"
$ ros2 service call /add_two_ints example_interfaces/AddTwoInts "a: '1', b:'2'"
$ ros2 service call /add_two_ints example_interfaces/AddTwoInts "a:'1'" "b:'2'"
$ ros2 service call /add_two_ints example_interfaces/AddTwoInts "a:'1'", "b:'2'"
2021-04-15 10:19:04 -0500 marked best answer ROS2 Best practices: multiple nodes in the same process

Hi,

I was wondering if there are any best practices for implementing multiple ROS2 nodes in the same process.

So far I see the following options:

  • std::thread / pthread
  • SingleThreadedExecutor
  • MultiThreadedExecutor
  • composition API

From my understanding of the topic, the composition API should be used whenever we want to define which nodes to use at runtime.

On the other hand, all the other methods require the nodes to be specified at compile time.

I'm currently using mainly std::thread or pthread, as they integrate nicely with other non-ROS code. However I'm also trying to make some experiments about the performance of the ROS executors, to see how they compare with simply spawning a new thread for each node I have.

I noticed that all the examples in the ROS2 tutorial use the executors, what's their advantage?

Thanks

2021-04-15 10:18:58 -0500 received badge  Great Question (source)
2021-03-31 09:50:37 -0500 received badge  Nice Question (source)
2021-03-24 13:29:18 -0500 answered a question Error build Machine Learning packages

The build of your turtlebot packages correctly succeeded. What you got is just a developer warning, you can safely ignor

2021-03-24 13:26:42 -0500 edited question Error build Machine Learning packages

Error build Machine Learning packages Hi, im trying to follow these tutorial https://emanual.robotis.com/docs/en/platfor

2021-03-24 13:26:06 -0500 edited question Error build Machine Learning packages

Error build Machine Learning packages Hi, im trying to follow these tutorial https://emanual.robotis.com/docs/en/platfor

2021-03-24 13:22:46 -0500 answered a question How to use the latest version of Fastdds on ros2?

Yes, that would be the way forward. However I'm pretty confident that you will have several build and/or runtime issues

2021-03-24 07:53:49 -0500 commented answer [ROS2] best practice for composable node publishing data from blocking call

Ahah I wrote that example some time ago and I forgot about it =) That's exactly what I Indented here. That approach of

2021-03-24 07:50:43 -0500 commented answer [ROS2] best practice for composable node publishing data from blocking call

Ahah I wrote that example some time ago and I forgot about it =) That's exactly what I Indented here. That approach of

2021-03-23 17:56:42 -0500 answered a question [ROS2] best practice for composable node publishing data from blocking call

I don't think that your loop is particularly odd. There are definitely ways to do it differently (i.e. without having to

2021-03-23 17:42:09 -0500 answered a question What is the best path for an Ackermann controller?

Hi. I think that your build issues are not related to the nav2 stack, but rather to your environment. As you can see he

2021-03-23 15:36:15 -0500 received badge  Notable Question (source)
2021-03-23 15:18:05 -0500 answered a question Add nested namespace to nodes

I found a solution in the ROS 2 nav stack where in the constructor of a node there is the following Costmap2DROS::Costm

2021-03-21 05:35:46 -0500 received badge  Popular Question (source)