Question for course ROS manipulator

The problem is in ex 5.2. I created the folder “my_motion_scripts”. When I run the launch file I get the following error:
[planning_scripts_node_launch-1] process has finished cleanly
log file: /home/user/.ros/log/b08b8c8c-1b35-11ef-b4bd-0242c0a8d006/planning_scripts_node_launch-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor…
… shutting down processing monitor complete
How can I fix it?

Hi @huynhtancuongrus, welcome to the community!

What you shared isn’t an error, it’s just your program finishing cleanly.

You should structure your file with an __init__ method that initializes the node, as well as a main() function as an entry point where you spin the node.

Something like:

class RobotClass(Node):

    def __init__(self):
        super().__init__("my_node")

def main():
    rospy.init()
    my_node = RobotClass()
    rospy.spin(my_node)
    rospy.shutdown()


if __name__ == "__main__":
    main()

I recommend taking our course ROS Basics in 5 Days (Python) to get a deeper understanding on creating ROS nodes in Python.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.