Ask Your Question

Spectre's profile - activity

2022-05-14 05:44:32 -0500 received badge  Necromancer (source)
2021-08-05 15:37:00 -0500 received badge  Famous Question (source)
2021-06-01 16:49:20 -0500 commented answer I am new to ROS and am wondering about the difference between launch script and launch node?

Elaborating further: You create a node with some processes you wish to be carried-out such as interfacing with a serial

2021-05-31 13:20:23 -0500 answered a question Setting logging directory per Node in Foxy

It's a bit late, but it looks like this feature has been implemented in the latest ROS2 release, Galactic Geochelone! C

2021-05-17 13:14:04 -0500 commented question Setting logging directory per Node in Foxy

You could try splitting your nodes into individual launch files, and then make a "master" launch file that references th

2021-05-17 12:17:47 -0500 received badge  Notable Question (source)
2021-05-17 09:20:55 -0500 received badge  Self-Learner (source)
2021-05-16 22:18:45 -0500 received badge  Popular Question (source)
2021-05-16 22:18:18 -0500 marked best answer [ROS2] Node Becomes Zombie, All Pubs/Subs "Dead" But Node Remains Active

I have a node which is responsible for communicating with an Arduino via USB Serial. It seems to have problems only when it is receiving subscription data. I have another node acting as a PID speed controller publishing PWM values, and the Arduino node has two subscribers for these values (one per motor).

Everything seems to start fine, but after reaching some unknown condition the Arduino node just simply stops responding. I cannot find any errors, warnings, etc. in the logs. I haven't observed any caught or uncaught exceptions. In fact, the node still catches keyboard interrupt exceptions and prints a corresponding "I was caught" info message to the ROS log.

Running ros2 node list shows that the node is still alive.

Running ros2 topic list -t shows that subscribers of other nodes are still listening to topics for messages that the Arduino node would normally publish.

Running ros2 doctor --report | less shows that all of the publishers and subscribers within the Arduino node are completely missing.

This is further corroborated by running ros2 topic echo <arduino_published_topic> <message_type> and seeing absolutely nothing whereas previously messages were being published quite frequently. Additionally, echoing topics from other concurrently-running nodes does produce a steady stream of messages.

None of this is running in a simulated manner. I have a robot which contains a RaspberryPi 4 and the Arduino, and I interact with them over wifi. Running all of the above commands on the RaspberryPi 4, as opposed to my main desktop computer, on my home network (i.e. congestion or network management can be ruled-out), shows no difference in behavior.

I'm not sure how much I should copy/paste from my node as it has grown quite long, but below are some relevant tidbits. Let me know if I should elaborate further on anything!

Also one final thing I will mention is that the PID Velocity controller producing the subscribed messages has a much lower publish frequency than any of the publishers and timers in this node (0.2 sec per publish vs 0.05 sec per encoder publish from serial_arbiter, for example).

# "Arduino node", called serial_arbiter.py
class SerialArbiter(Node):

    def __init__(self):
        super().__init__('serial_arbiter')
        # Omitting most parts where I declare params, retrieve param values, spit them to the logger

        # Declare Parameters and default values
        self.declare_parameter('serial_port_path', '/dev/ttyACM0')
        self.declare_parameter('serial_baud_rate', 115200)

        self.arduino = SerialComms(self.serial_port_path, self.serial_baud_rate)
        self.arduino.reset_encoders()

        # Publishers and timers are declared here, but these are the only two subscribers.
        self.subscriber_motor_right = self.create_subscription(Int16, 'set_motor_power_right', self.subscribed_motor_right_cb, 10)
        self.subscriber_motors_left = self.create_subscription(Int16, 'set_motor_power_left', self.subscribed_motor_left_cb, 10)

    # Omitting probably-irrelevant callback functions
    def subscribed_motor_right_cb(self, message):

        try:
            self.arduino.set_motor_power(self.arduino.RIGHT, int(message.data))
        except Exception as e:
            self.get_logger().error("Failed to update Motor 1 power: '{}'".format(e))
            pass

    def subscribed_motor_left_cb(self, message):

        try:
            self.arduino.set_motor_power(self.arduino.LEFT, int(message.data))
        except Exception as e:
            self.get_logger().error("Failed to update Motor 2 power: '{}'".format(e))
            pass ...
(more)
2021-05-16 22:18:18 -0500 received badge  Scholar (source)
2021-05-16 22:18:10 -0500 answered a question [ROS2] Node Becomes Zombie, All Pubs/Subs "Dead" But Node Remains Active

It took a lot of trial and error but I traced the problem to my serial_send function. The "dead" state of publishers an

2021-05-16 21:53:15 -0500 answered a question Amcl:No laser scan received

When your warning messages refer to a "transform" they are referring to /tf topic messages. It sounds like you need a "

2021-05-16 21:53:15 -0500 received badge  Rapid Responder (source)
2021-05-15 14:23:33 -0500 commented answer Hello, i am trying to do colcon build --symlink-install but getting following error. Any idea what is happening here?

(...) same error comes up for rosidl_typesupport_introspection_c package. Is this package also for creating custom me

2021-05-15 13:43:16 -0500 commented answer Explain in detail what each node does to which topic it sends, I don't understand anything

Another important one to point out is that robot_state_publisher on the right side. As you can see from the flowchart it

2021-05-15 13:42:48 -0500 commented answer Explain in detail what each node does to which topic it sends, I don't understand anything

Another important one to point out is that robot_state_publisher on the right side. As you can see from the flowchart it

2021-05-15 13:42:39 -0500 commented answer Explain in detail what each node does to which topic it sends, I don't understand anything

Another important one to point out is that robot_state_publisher on the right side. As you can see from the flowchart it

2021-05-15 13:41:07 -0500 commented answer Explain in detail what each node does to which topic it sends, I don't understand anything

Another important one to point out is that robot_state_publisher on the right side. As you can see from the flowchart it

2021-05-15 13:13:46 -0500 commented answer Explain in detail what each node does to which topic it sends, I don't understand anything

To further clarify on the given example: move_base is publishing a "twist" message on the /cmd_vel topic. This is a Tw

2021-05-13 18:51:42 -0500 commented answer Hello, i am trying to do colcon build --symlink-install but getting following error. Any idea what is happening here?

Ahh I see. I avoided that page altogether and instead followed the "Installing Ros 2 on Ubuntu Linux" instructions page

2021-05-13 17:34:34 -0500 commented question Launching 2 ros nodes

What kind of parameters are these? Will they need to change after Node 2 has launched? Do you intend to launch Node 3/4/

2021-05-13 17:23:22 -0500 commented answer Hello, i am trying to do colcon build --symlink-install but getting following error. Any idea what is happening here?

I misspoke; I meant /opt/ros which would contain everything within distribution-specific subdirectories. It sounds like

2021-05-13 17:22:55 -0500 commented answer Hello, i am trying to do colcon build --symlink-install but getting following error. Any idea what is happening here?

I misspoke; I meant /opt/ros which would contain everything within distribution-specific subdirectories. It sounds like

2021-05-13 17:22:55 -0500 received badge  Commentator
2021-05-13 17:17:07 -0500 commented answer Hello, i am trying to do colcon build --symlink-install but getting following error. Any idea what is happening here?

Clarification: I meant /opt/ros not /opt/ros2

2021-05-13 15:40:31 -0500 answered a question Hello, i am trying to do colcon build --symlink-install but getting following error. Any idea what is happening here?

That's quite a noisy output! The words not found appear 120 times in that blurb. It looks like it's related specificall

2021-05-13 15:40:31 -0500 received badge  Rapid Responder (source)
2021-05-13 15:23:54 -0500 commented question Launching 2 ros nodes

Maybe there's an alternative approach. I don't think you'll be able to do this with a launch file, but you could probabl

2021-05-13 15:20:26 -0500 answered a question How to change log directory on ROS2 Foxy?

I haven't seen any references to changing the log file directory, but there are two options: Use a logging configurati

2021-05-13 15:20:26 -0500 received badge  Rapid Responder (source)
2021-05-12 15:46:24 -0500 commented answer can ros packages be directly used in ROS2?

Adding to this: Many of the "little" things have changed with ROS2 (e.g. declaring parameters before their use, how the

2021-05-12 15:46:09 -0500 commented answer can ros packages be directly used in ROS2?

Adding to this: Many of the "little" things have changed with ROS2 (e.g. declaring parameters before their use, how the

2021-05-12 15:38:20 -0500 edited question [ROS2] Node Becomes Zombie, All Pubs/Subs "Dead" But Node Remains Active

[ROS2] Node Becomes Zombie, All Pubs/Subs "Dead" But Node Remains Active I have a node which is responsible for communic

2021-05-12 15:35:49 -0500 edited question [ROS2] Node Becomes Zombie, All Pubs/Subs "Dead" But Node Remains Active

[ROS2] Node Becomes Zombie, All Pubs/Subs "Dead" But Node Remains Active I have a node which is responsible for communic

2021-05-12 15:35:18 -0500 edited question [ROS2] Node Becomes Zombie, All Pubs/Subs "Dead" But Node Remains Active

[ROS2] Node Becomes Zombie, All Pubs/Subs "Dead" But Node Remains Active I have a node which is responsible for communic

2021-05-12 15:35:18 -0500 received badge  Editor (source)
2021-05-12 15:34:24 -0500 asked a question [ROS2] Node Becomes Zombie, All Pubs/Subs "Dead" But Node Remains Active

[ROS2] Node Becomes Zombie, All Pubs/Subs "Dead" But Node Remains Active I have a node which is responsible for communic

2021-05-12 04:06:13 -0500 answered a question ros2 launch or python3 foo.launch.py

From what I've seen the ros2 launch <pkg> <launch_file> method is the "proper" way of doing it. If I had to

2021-05-12 04:06:13 -0500 received badge  Rapid Responder (source)
2021-05-12 02:54:27 -0500 commented question ROS2 how to make a node read files

When you build a ROS2 package using colcon build an install/ directory will be generated with your package and its files

2021-05-11 20:54:13 -0500 edited answer RPI4 IMU ROS ERROR: 'required argument is not a float' when writing 'header: ....

I'm more familiar with ROS2 than ROS1, but it could be the lines: current_time = rospy.Time.now() h.stamp = current_tim

2021-05-11 20:51:33 -0500 answered a question RPI4 IMU ROS ERROR: 'required argument is not a float' when writing 'header: ....

I'm more familiar with ROS2 than ROS1, but it could be the lines: current_time = rospy.Time.now() h.stamp = current_tim

2021-05-11 20:51:33 -0500 received badge  Rapid Responder (source)
2021-05-11 20:13:00 -0500 commented answer Balancing Two-Wheeled Robot in ROS2-Foxy

Adding onto this post, I found it helpful to look through these links: A ROS1 differential drive node created by Jon S

2021-05-11 20:12:35 -0500 commented answer Balancing Two-Wheeled Robot in ROS2-Foxy

Adding onto this post, I found it helpful to look through these links: A ROS1 differential drive node created by Jon S

2021-05-11 20:11:42 -0500 commented answer Balancing Two-Wheeled Robot in ROS2-Foxy

Adding onto this post, I found it helpful to look through these links: A ROS1 differential drive node created by Jon S

2021-05-11 20:11:24 -0500 commented answer Balancing Two-Wheeled Robot in ROS2-Foxy

Adding onto this post, I found it helpful to look through these links: - A ROS1 differential drive node created by Jon

2021-05-11 20:11:16 -0500 commented answer Balancing Two-Wheeled Robot in ROS2-Foxy

Adding onto this post, I found it helpful to look through these links: - A ROS1 differential drive node created by Jon

2021-05-11 20:11:06 -0500 commented answer Balancing Two-Wheeled Robot in ROS2-Foxy

Adding onto this post, I found it helpful to look through these links: - A ROS1 differential drive node created by Jon