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

KenYN's profile - activity

2023-10-30 23:37:48 -0500 received badge  Notable Question (source)
2023-10-30 23:37:48 -0500 received badge  Famous Question (source)
2023-10-07 06:37:45 -0500 received badge  Famous Question (source)
2023-10-07 06:37:45 -0500 received badge  Notable Question (source)
2023-09-19 23:27:39 -0500 received badge  Famous Question (source)
2023-09-19 23:27:39 -0500 received badge  Notable Question (source)
2023-07-25 06:52:35 -0500 received badge  Nice Answer (source)
2023-05-02 13:12:49 -0500 received badge  Good Question (source)
2023-03-27 01:25:48 -0500 received badge  Nice Question (source)
2023-01-02 20:56:59 -0500 marked best answer Getting a Node::SharedPtr from "this"

A number of functions expect a rclcpp::Node::SharedPtr, but when you are in an rclcpp::Node subclass it is not available, and of course something like foo(rclcpp::Node::SharedPtr(this)); is a great way to crash your program. Is there some registry of these SharedPtrs to query?

2023-01-02 20:56:55 -0500 received badge  Nice Question (source)
2022-10-27 11:41:51 -0500 received badge  Popular Question (source)
2022-10-07 09:56:25 -0500 received badge  Notable Question (source)
2022-09-17 02:55:07 -0500 received badge  Famous Question (source)
2022-07-07 11:27:07 -0500 marked best answer ROS 2 time handling

In ROS 1 my node has code like this in a subscribed message callback:

ros::Time now = ros::Time::now();
ros::Duration frameSkip = ros::Duration(m_frameSyncMs/1000.0);

// Proceed if time interval has elapsed or if clock has gone backwards
if (m_previousTimeStamp + frameSkip > now)
// etc...

Basically, when m_frameSyncMs is 100 ms with the topic being a camera feed at 30 fps, just pick out every third frame or so. This works quite happily.

Now, for ROS 2 there no longer is a Time::now(), and looking at various web pages there might be a node clock, or there might be an rcl_get_time_point_now() but shouldn't that also take the result of rcl_get_default_ros_time()?

What is the best way to do this? Furthermore, where is the best place to learn about the latest ROS 2 developments; GitHub and Discord, for instance seem a bit too light on information, and reading the source might work, but the next beta may very well invalidate everything. Finally is there a ros2bag or equivalent for recording and playing back runs?

2022-06-23 14:23:18 -0500 received badge  Nice Answer (source)
2022-04-21 11:19:24 -0500 received badge  Famous Question (source)
2022-04-12 21:21:31 -0500 received badge  Famous Question (source)
2022-04-12 21:21:31 -0500 received badge  Notable Question (source)
2022-04-12 21:21:31 -0500 received badge  Popular Question (source)
2022-04-11 15:17:57 -0500 received badge  Favorite Question (source)
2022-04-11 02:42:14 -0500 received badge  Popular Question (source)
2022-04-04 04:44:23 -0500 received badge  Famous Question (source)
2022-03-04 11:41:14 -0500 received badge  Notable Question (source)
2022-03-04 11:41:14 -0500 received badge  Famous Question (source)
2022-02-17 01:58:44 -0500 edited question message_filters::Synchronizer<>::registerCallback and lambdas syntax

message_filters::Synchronizer<>::registerCallback and lambdas syntax I can do: sync.registerCallback(std::bind(&a

2022-02-17 01:57:43 -0500 asked a question message_filters::Synchronizer<>::registerCallback and lambdas syntax

message_filters::Synchronizer<>::registerCallback and lambdas syntax I can do: sync.registerCallback(std::bind(&a

2022-02-17 01:57:41 -0500 asked a question message_filters::Synchronizer<>::registerCallback and lambdas syntax

message_filters::Synchronizer<>::registerCallback and lambdas syntax I can do: sync.registerCallback(std::bind(&a

2022-02-08 13:27:25 -0500 received badge  Notable Question (source)
2022-02-08 07:23:40 -0500 received badge  Popular Question (source)
2022-02-01 08:00:58 -0500 received badge  Nice Question (source)
2022-01-25 14:59:41 -0500 received badge  Necromancer (source)
2021-12-30 08:42:20 -0500 received badge  Famous Question (source)
2021-12-30 08:42:20 -0500 received badge  Notable Question (source)
2021-12-30 08:42:20 -0500 received badge  Popular Question (source)
2021-12-29 02:16:37 -0500 received badge  Popular Question (source)
2021-12-29 02:16:37 -0500 received badge  Notable Question (source)
2021-12-29 02:16:37 -0500 received badge  Famous Question (source)
2021-12-19 22:11:11 -0500 received badge  Popular Question (source)
2021-12-17 00:53:03 -0500 marked best answer static_transform_publisher doesn't latch on ROS2

On Noetic, I can do the following:

$ run tf2_ros static_transform_publisher 1 1 1 0 0 0 f1 f2 &
[2] 1753768
[ INFO] [1639635211.900468919]: Spinning until killed publishing f1 to f2
$ rostopic echo /tf_static 
transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 1639635211
        nsecs: 900398326
      frame_id: "f1"
    child_frame_id: "f2"
    transform: 
      translation: 
        x: 1.0
        y: 1.0
        z: 1.0
      rotation: 
        x: 0.0
        y: 0.0
        z: 0.0
        w: 1.0

This is exactly what I expect to happen since the static publisher is latched.

However, on Galactic using CycloneDDS:

$ ros2 run tf2_ros static_transform_publisher --x 1 --y 1 --z 1 --frame-id f1 --child-frame-id f2 &
[1] 213102
1639635686.858624 [0] static_tra: selected interface "lo" is not multicast-capable: disabling multicast
[INFO] [1639635686.868694587] [static_transform_publisher_GjMa6BC7irM5FXBs]: Spinning until stopped - publishing transform
translation: ('1.000000', '1.000000', '1.000000')
rotation: ('0.000000', '0.000000', '0.000000', '1.000000')
from 'f1' to 'f2'
$ ros2 topic echo /tf_static 
1639635697.443620 [0]       ros2: selected interface "lo" is not multicast-capable: disabling multicast

No output is produced, but ros2 topic keeps waiting. I'm using loopback as our routers don't like multicast, but since it can find the topic /tf_static shouldn't it also be able to find the message since it uses the durability policy transient local? Or am I misunderstanding something?

I also found this GitHub bug report that suggests:

ros2 topic echo --qos-durability transient_local /tf_static

However, that fails in the same way as above for me.

2021-12-17 00:52:11 -0500 edited answer static_transform_publisher doesn't latch on ROS2

I had tried: ros2 topic echo --qos-durability transient_local /tf_static But GitHub told me that I also need --qos-re

2021-12-17 00:51:44 -0500 received badge  Rapid Responder (source)
2021-12-17 00:51:44 -0500 answered a question static_transform_publisher doesn't latch on ROS2

I had tried: ros2 topic echo --qos-durability transient_local /tf_static But GitHub told me that I also need --qos-re