Week 2 - ROS 2 Spin Logic & Design Decisions (June 10 ~ 16)
Hey everyone!
This week continued the Phase One of my GSoC project with JdeRobot, where I’m working on porting the Follow Line exercise to use ROS 2-native code inside Robotics Academy.
Objectives for the Week
- Clarify whether we should skip
prepare_RA_code()
or not - Understand BT Studio vs RA exercise structure
- Decide: new exercise vs modifying the current one
- Make Follow Line work with
rclpy.spin()
What I Worked On
We kicked off the week with a sync-up meeting with the mentors to review progress and set technical goals.
From there, I focused on clarifying whether ROS 2-native migration should create a new exercise or extend the existing one. After prototyping and analyzing system dependencies like lap.py
, gui.py
, and how prepare_RA_code()
is tightly coupled with the exercise flow, I concluded that modifying the existing Follow Line exercise would be the more scalable and cleaner approach.
Why?
- Modifying the current setup keeps system architecture intact.
- Key features like the GUI and lap tracking would require major rework otherwise.
- Future ROS-native migrations will also be easier this way.
I got ROS 2-native logic running with rclpy.spin()
inside the exercise. Here’s what I updated:
- Modified the linter to check for either a
while True
loop or presence ofrclpy.spin()
. - Tweaked
prepare_RA_code()
to ensure spin-based code runs as expected. - Temporarily skipped
add_frequency_control()
for now, since there’s discussion around a newer frequency management method.
rclpy.spin() logic running inside the Follow Line exercise
I’ll be checking in with my mentors to confirm whether this is the right direction for the ROS 2 integration and also to better understand how frequency control is expected to be handled going forward.
Additional Work
Outside the main objectives, I also explored:
- Creating a GUI publisher node, so the user can publish processed images to a topic and have them show on the web frontend. The topic is working, but threading and lifecycle bugs remain — still a work in progress.
- Implemented basic logging redirection to the terminal inside the Docker container. Currently, logs don’t show on the VNC GUI console. I’ll check if this behavior is intended or something to fix.
Key Learnings & Outcomes
- Learned how RAM handles linting and code patching (especially the
while True
check) - Understood the importance of maintaining compatibility with existing utilities like
lap.py
andGUI
- Validated that
rclpy.spin()
can work inside the current flow with minimal structural changes - Raised and resolved two tickets this week related to exercise structure and rclpy.spin() integration.
Thanks for reading! Next week, I’ll finalize how to structure the GUI topic subscription and revisit frequency control to integrate it cleanly with ROS-native logic.
Until next week —
Ashish