Repository navigation
base_node.md
dingdongdengdong edited this page May 5, 2025
·
1 revision
graph TD
A[Start] --> B{Initialize ROS 2};
B --> C[Create base_node];
C --> D[Get Logger];
D --> E[Declare Parameter device];
E --> F[Get Parameter Value];
F --> G[Instantiate BaseController];
G --> H[Initialize Pose Variables];
H --> I[Create Odometry Publisher];
H --> J[Create TF Broadcaster];
J --> K[Assign State Callback to BaseController];
K --> L[Create cmd_vel Subscriber];
L --> M[Create Debug Publishers];
M --> N[Assign Debug Callback to BaseController];
N --> O[rclpy.spin node];
O --> P[State Callback Triggered by BaseController];
P --> Q[Calculate Position Increments];
Q --> R[Update Pose variables];
R --> S[Convert Yaw to Quaternion];
S --> T[Create and Populate Odometry Msg];
T --> U[Publish Odometry Msg];
U --> V[Create and Populate TF Transform Msg];
V --> W[Broadcast TF Transform];
W --> O;
O --> X[cmd_vel Callback Triggered];
X --> Y[Get Linear and Angular Velocity];
Y --> Z[Call base_controller.set_vel];
Z --> O;
O --> AA[Debug Callback Triggered by BaseController];
AA --> AB{Debug Topic Name Valid?};
AB -- Yes --> AC[Create Float32 Msg];
AC --> AD[Set Msg Data];
AD --> AE[Publish Debug Msg];
AE --> O;
AB -- No --> O;
O --> AF[Keyboard Interrupt];
AF --> AG[Call base_controller.stop];
AG --> AH[Raise KeyboardInterrupt];
O --> AI[Node Shutdown];
AI --> AJ[ROS 2 Shutdown];
AJ --> AK[End];