"""OnboardingNode."""
import rclpy
from kitcar_utils.ros_base.node_base import NodeBase
[docs]
class OnboardingNode(NodeBase):
"""ROS node to teach new members."""
def __init__(self):
"""Initialize the node."""
super().__init__(name="onboarding_node")
# Start running node
# This will do the following
# 1) Call self.start()
# 2) Call self.steer() 60 times a second!
# 3) Call self.stop() when ROS is shutting down
self.run(function=self.steer, rate=60)
[docs]
def start(self):
"""Start node."""
# When overwriting a function, ensure that the original function (NodeBase.start())
# is also called
super().start()
[docs]
def stop(self):
"""Turn off node."""
# When overwriting a function, ensure that the original function (NodeBase.stop())
# is also called
super().stop()
[docs]
def steer(self):
"""Control the car's pose to drive along the road."""
pass
[docs]
def main(args=None):
"""Console-script entry point for the onboarding node."""
rclpy.init(args=args)
try:
OnboardingNode()
except KeyboardInterrupt:
pass
finally:
if rclpy.ok():
rclpy.shutdown()