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

anastasiaPan's profile - activity

2022-08-19 02:58:13 -0500 received badge  Famous Question (source)
2022-06-27 04:13:02 -0500 received badge  Nice Question (source)
2022-06-16 09:09:27 -0500 received badge  Stellar Question (source)
2022-06-16 09:09:24 -0500 received badge  Good Question (source)
2022-01-18 06:39:29 -0500 received badge  Notable Question (source)
2022-01-18 06:39:29 -0500 received badge  Popular Question (source)
2021-10-27 09:54:26 -0500 received badge  Nice Question (source)
2021-09-24 07:34:30 -0500 received badge  Enlightened (source)
2021-09-24 07:34:30 -0500 received badge  Good Answer (source)
2021-09-24 03:19:48 -0500 commented answer [ros2][galactic]Shutdown node when log level is ERROR or FATAL

Thanks for your answers! I will look into getting an output from the node instead of a logging error. Otherwise I might

2021-09-24 03:17:33 -0500 commented answer [ros2][galactic]Shutdown node when log level is ERROR or FATAL

Thanks for your answers! I will look into getting an output from the node instead of a logging error. Otherwise I might

2021-09-24 01:16:59 -0500 commented answer [ros2][galactic]Shutdown node when log level is ERROR or FATAL

I am aware of the lifecycle nodes and this is what I am using when I am developing. The foxy branch is used in the offic

2021-09-23 08:52:22 -0500 asked a question [ros2][galactic]Shutdown node when log level is ERROR or FATAL

[ros2][galactic]Shutdown node when log level is ERROR or FATAL Hello I have a node launched by my own launch file (speci

2021-09-02 03:08:27 -0500 received badge  Famous Question (source)
2021-07-01 19:06:32 -0500 received badge  Famous Question (source)
2021-06-26 16:54:02 -0500 received badge  Nice Answer (source)
2021-06-21 02:28:50 -0500 commented answer [ROS2][foxy][launch] Restart node every time it exits - launch file

Thank you for the answer! I am using the respawn feature for quite some time now and it works fine but I might try your

2021-06-21 02:28:03 -0500 received badge  Supporter (source)
2021-06-18 06:49:20 -0500 received badge  Famous Question (source)
2021-05-27 12:26:28 -0500 received badge  Notable Question (source)
2021-05-19 14:22:38 -0500 received badge  Self-Learner (source)
2021-05-06 04:47:10 -0500 received badge  Favorite Question (source)
2021-05-06 04:45:25 -0500 received badge  Popular Question (source)
2021-05-05 10:22:51 -0500 edited question [ROS2][foxy][launch testing] Integration testing with launch testing

[ROS2][foxy][launch testing] Integration testing with launch testing I would like to do integration test using https://i

2021-05-05 10:22:19 -0500 edited question [ROS2][foxy][launch testing] Integration testing with launch testing

[ROS2][foxy][launch testing] Integration testing with launch testing I would like to do integration test using https://i

2021-05-05 10:21:04 -0500 asked a question [ROS2][foxy][launch testing] Integration testing with launch testing

[ROS2][foxy][launch testing] Integration testing with launch testing I would like to do integration test using https://i

2021-05-05 10:07:39 -0500 commented question [ROS2 foxy] ros2 topic pub - with current timestamp

No I haven't

2021-05-05 10:06:46 -0500 marked best answer [ROS2 foxy] QoS durability transient_local rclpy to echo /robot_description

I woud like to subscribe to the robot_description coming from the robot state publisher and then from that derive the tf_static since it is supposed to be a urdf in String form. I am sure that the robot_description topic is published with the QoS durability option set to transient_local.

Robot state publisher

The robot state publisher works ok since I can see the output from it and it runs ok. I can also echo /tf_static.

[robot_state_publisher.EXE-1] Parsing robot urdf xml string.
[robot_state_publisher.EXE-1] Link LDS-01 had 6 children
[robot_state_publisher.EXE-1] Link solid(1)_707 had 0 children
[robot_state_publisher.EXE-1] Link screw0_746 had 0 children
[robot_state_publisher.EXE-1] Link screw1_793 had 0 children
[robot_state_publisher.EXE-1] Link screw2_840 had 0 children
[robot_state_publisher.EXE-1] Link screw3_887 had 0 children
[robot_state_publisher.EXE-1] Link solid_722 had 0 children
[robot_state_publisher.EXE-1] Link imu_link had 0 children
[robot_state_publisher.EXE-1] Link left wheel had 0 children
[robot_state_publisher.EXE-1] Link right wheel had 0 children
[robot_state_publisher.EXE-1] [INFO] [1612966920.980180100] [robot_state_publisher]: got segment LDS-01
[robot_state_publisher.EXE-1] [INFO] [1612966920.980240900] [robot_state_publisher]: got segment base_link
[robot_state_publisher.EXE-1] [INFO] [1612966920.980262100] [robot_state_publisher]: got segment imu_link
[robot_state_publisher.EXE-1] [INFO] [1612966920.980273600] [robot_state_publisher]: got segment left wheel
[robot_state_publisher.EXE-1] [INFO] [1612966920.980284000] [robot_state_publisher]: got segment right wheel
[robot_state_publisher.EXE-1] [INFO] [1612966920.980295000] [robot_state_publisher]: got segment screw0_746
[robot_state_publisher.EXE-1] [INFO] [1612966920.980304500] [robot_state_publisher]: got segment screw1_793
[robot_state_publisher.EXE-1] [INFO] [1612966920.980314300] [robot_state_publisher]: got segment screw2_840
[robot_state_publisher.EXE-1] [INFO] [1612966920.980323900] [robot_state_publisher]: got segment screw3_887
[robot_state_publisher.EXE-1] [INFO] [1612966920.980330500] [robot_state_publisher]: got segment solid(1)_707
[robot_state_publisher.EXE-1] [INFO] [1612966920.980340800] [robot_state_publisher]: got segment solid_722

Output of ros2 topic info /robot_description --verbose :

Publisher count: 1

Node name: robot_state_publisher
Node namespace: /
Topic type: std_msgs/msg/String
Endpoint type: PUBLISHER
GID: 01.0f.af.50.f4.2e.00.00.01.00.00.00.00.00.15.03.00.00.00.00.00.00.00.00
QoS profile:
  Reliability: RMW_QOS_POLICY_RELIABILITY_RELIABLE
  Durability: RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL
  Lifespan: 2147483651294967295 nanoseconds
  Deadline: 2147483651294967295 nanoseconds
  Liveliness: RMW_QOS_POLICY_LIVELINESS_AUTOMATIC
  Liveliness lease duration: 2147483651294967295 nanoseconds

Subscription count: 0

Echoing attempt

ros2 topic echo --qos-durability=transient_local /robot_description std_msgs/msg/String

I have tried also:

ros2 topic echo --qos-durability=transient_local /robot_description

But none of these worked

Subscription attempt

import rclpy
from rclpy.node import Node
from std_msgs.msg import String
from rclpy.qos import QoSProfile, QoSDurabilityPolicy, QoSReliabilityPolicy

class WebotsStatusPublisher(Node):

    def __init__(self):
        super().__init__('docker_bridge_node')  

        self.latching_qos=QoSProfile(depth=1,reliability=QoSReliabilityPolicy.RMW_QOS_POLICY_RELIABILITY_RELIABLE,durability=QoSDurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL)
        self.robot_desc_subscription = self.create_subscription(String,'robot_description',self.robot_desc_listener_callback, self.latching_qos)
        self.robot_desc_publisher = self.create_publisher(String,'robot_description_bridge', self.latching_qos)

        self.robot_desc_subscription

    def robot_desc_listener_callback(self, msg):
        print("I got the robot description")
        self.robot_desc_publisher.publish(msg)

    def main(args=None):
        rclpy.init(args=args)
        webots_status = WebotsStatusPublisher()
        rclpy.spin(webots_status)
        webots_status.destroy_node()
        rclpy.shutdown()


if __name__ == '__main__':
    main()

And it is still not possible to subscribe to it. I have checked the documentation both for the robot state publisher (https://index.ros.org/r/robot_state_p...) and for the quality of service profile (http://docs.ros2.org/latest/api/rclpy...) and it seems to me that I am ... (more)

2021-05-05 10:06:13 -0500 received badge  Notable Question (source)
2021-04-27 10:47:09 -0500 received badge  Notable Question (source)
2021-04-21 18:31:28 -0500 received badge  Famous Question (source)
2021-04-21 03:55:01 -0500 received badge  Popular Question (source)
2021-04-15 01:42:35 -0500 marked best answer [ROS2][foxy][launch] Restart node every time it exits - launch file

Hello
I have a ros launch file that starts a few nodes. One of them exits under some conditions and I want to restart it every time when that happens. The whole idea is that I have a process that runs my simulator (specifically Webots). I have another process that starts a controller for my robot and whenever I reset the simulation I want to be able to restart my controller node without everything shutting down. What I have now is (it is a bit 'stupid' but I do not have any better ideas):

   controller =  Node(
        package=my_package,
        executable=my_executable,
    )

   cmd = ['ros2', 'run', 'my_package', 'my_executable']
   restart_controller = ExecuteProcess(cmd=cmd,shell=True)

   launch_description = LaunchDescription(ARGUMENTS + [
           robot_state_publisher,
           simulator,
           controller,

        # Restart controller when it breaks
        RegisterEventHandler(
            event_handler=launch.event_handlers.OnProcessExit(
                target_action=controller,
                on_exit=[restart_controller],
            )
        ),     

        RegisterEventHandler(
            event_handler=launch.event_handlers.OnProcessExit(
                target_action=restart_controller,
                on_exit=[controller],
            )
        ), 

        # Shutdown launch when Webots exits.
        RegisterEventHandler(
            event_handler=launch.event_handlers.OnProcessExit(
                target_action=simulator,
                on_exit=[EmitEvent(event=launch.events.Shutdown())],
            )
        )
    ])

If I start the controller node again and again from a terminal it works every time but here I see that in the ExecuteProcess method whenever I try to run the same process it crashes and raises a runtime error that says "ExecuteProcess action executed more than once".

Another thing is that the ros package is in Python (it cannot be in cpp for now at least) so it is not possible to make it a managed node and use the lifecycle utilities (configure-activate-shutdown etc.) which was my original idea.

I am also open to a better idea to do what I want if it is impossible to re-execute a process.

2021-04-15 01:42:05 -0500 answered a question [ROS2][foxy][launch] Restart node every time it exits - launch file

I have fixed this by switching to ROS rolling. Rolling distro has the option respawn in the ExecuteProcess.

2021-04-15 01:42:05 -0500 received badge  Rapid Responder (source)
2021-04-14 01:55:26 -0500 edited question [ROS2][foxy][launch] Restart node every time it exits - launch file

[ROS2][foxy][launch] Restart node every time it exits - launch file Hello I have a ros launch file that starts a few no

2021-04-14 01:54:37 -0500 edited question [ROS2][foxy][launch] Restart node every time it exits - launch file

[ROS2][foxy][launch] Restart node every time it exits - launch file Hello I have a ros launch file that starts a few no

2021-04-14 01:53:35 -0500 asked a question [ROS2][foxy][launch] Restart node every time it exits - launch file

[ROS2][foxy][launch] Restart node every time it exits - launch file Hello I have a ros launch file that starts a few no

2021-03-17 16:40:21 -0500 received badge  Notable Question (source)
2021-03-17 15:28:10 -0500 received badge  Popular Question (source)
2021-03-15 20:05:45 -0500 received badge  Famous Question (source)
2021-02-25 23:39:05 -0500 received badge  Popular Question (source)
2021-02-16 08:22:43 -0500 asked a question [ROS2 foxy] ros2 topic pub - with current timestamp

[ROS2 foxy] ros2 topic pub - with current timestamp I want to publish a message with ros2 topic pub but use current time

2021-02-10 09:18:42 -0500 asked a question [ROS2 foxy] QoS durability transient_local rclpy to echo /robot_description

[ROS2 foxy] QoS durability transient_local rclpy to echo /robot_description I woud like to subscribe to the robot_descri

2021-02-02 01:48:19 -0500 received badge  Enthusiast