Skip to content

Commit 4bc43e5

Browse files
committed
week 5 blog
1 parent cced3c2 commit 4bc43e5

File tree

39 files changed

+11476
-341
lines changed

39 files changed

+11476
-341
lines changed

docs/_posts/12-07-25-Week 5.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
title: Week 5 - Mid Term Evaluation & Phase Two Begins! (July 07 ~ July 14)
3+
date: 2025-07-14
4+
categories: [Coding Period, Phase Two]
5+
tags: [robotics-academy, ros2, follow-line, vaccum-cleaner, coding-period, phase-two]
6+
---
7+
8+
Hey everyone!
9+
This week marked an important milestone as I wrapped up the **mid-term evaluation** and kicked off **Phase Two** of my GSoC project with **JdeRobot**. It was a packed week of work to get back on schedule after my exam break, and I’m excited to share the progress.
10+
11+
---
12+
13+
### Objectives for the Week
14+
15+
- [x] ROS Native Solution for `follow_line` exercise
16+
- [x] Image output in the GUI
17+
- [ ] Fix logging in the VNC Console
18+
19+
---
20+
21+
### What I Worked On
22+
23+
We began the week with the **Mid-term evaluation**. It was a valuable chance to reflect on the progress so far, review the work with my mentors, and set clear goals for the next phase. I’m happy to share that I passed with positive feedback, which has been very motivating.
24+
25+
![GSoc Feedback from mentors](assets/lib/week_5_gsoc.png)
26+
<sub><i>GSoc Feedback from mentors</i></sub>
27+
28+
The first ticket I worked on was implementing a solution for the follow line exercise using ROS. With the progress made in the last few weeks, apart from some minor issues, the follow line exercise now supports ROS native implementation. The solution developed is fully written in ROS, except for the GUI which partially uses the GUI module to display images (this will be fixed soon).
29+
30+
![Follow line exercise ROS Native implementation](assets/lib/week_5_fl.gif)
31+
<sub><i>Follow line exercise ROS Native implementation</i></sub>
32+
33+
---
34+
35+
After working on the ROS native solution, I started work on the image output in the GUI as well as the logging for the VNC Console. These two issues have been hurdles towards completion of the ROS native implementation. I was able to get them working (somewhat), but this is due to race conditions resulting in poor performance.
36+
Let me break it down.
37+
38+
#### Image output in the GUI
39+
I was able to get this working, but the output isn't as expected. To understand what the issue is, let me give a short summary on how this is being implemented.
40+
41+
Logic flow:
42+
43+
Topic Check: `_setup_auto_mode_if_possible()` checks if `/webgui_image` topic exists
44+
45+
If topic exists:
46+
1. Creates `CameraNode("/webgui_image")` to subscribe to it
47+
2. Sets `auto_image_mode = True`
48+
3. Starts `_unified_image_loop()` thread
49+
50+
If topic doesn't exist:
51+
1. No camera node created
52+
2. `auto_image_mode = False`
53+
3. Only manual mode available
54+
55+
This way if the topic exists , GUI automatically subscribes to it and starts showing the image published to it in the GUI, if the topic does not exist user can manually use the `showImage()` function to show an image on the GUI. This has been implemented and is working.
56+
57+
Automatic image sub from topic `/cam_f1_left/camera_info` :
58+
59+
![Automatic image sub from topic](assets/lib/week_5.png)
60+
<sub><i>Automatic image sub from topic /cam_f1_left/camera_info</i></sub>
61+
62+
Heres the debugging output from the GUI module:
63+
64+
```shell
65+
Initializing GUI...
66+
['/cam_f1_left/camera_info', '/cam_f1_left/image_raw', '/cam_f1_left/image_raw/compressed', '/cam_f1_left/image_raw/compressedDepth', '/cam_f1_left/image_raw/theora', '/clock', '/cmd_vel', '/odom', '/parameter_events', '/performance_metrics', '/rosout', '/tf']
67+
GUI Mode: {'auto_mode': True, 'topic_subscribed': '/webgui_image', 'manual_mode_available': True}
68+
GUI initialized!
69+
```
70+
71+
Now the issue is that:
72+
- The GUI module needs to be initialized within the user's code
73+
- A race condition exists which prevents the automatic functionality from working
74+
75+
The Problem: Timing Race Condition
76+
77+
- 1. GUI initializes first → checks for `/webgui_image` topic → doesn't exist yet
78+
- 2. Sets manual mode only
79+
- 3. Then user's code starts → creates `/webgui_image` topic
80+
- 4. Too late! GUI already decided it's manual mode
81+
82+
#### Fix logging in the VNC Console
83+
The VNC logging also faces a similar race condition issue. The following environment variables need to be initialized in the .env file:
84+
85+
```bash
86+
export RCUTILS_LOGGING_USE_STDOUT=1
87+
export RCUTILS_LOGGING_BUFFERED_STREAM=0
88+
export RCUTILS_CONSOLE_OUTPUT_FORMAT="[{severity}] [{name}]: {message}"
89+
```
90+
91+
These need to be initialized before ROS is initialized. Unfortunately, with my current development setup, I haven't been able to achieve this.
92+
93+
For both issues, I will be taking input from my mentors to see how we can fix this.
94+
95+
---
96+
97+
### Additional Progress
98+
99+
In addition to the main tasks, I also worked on a few other areas.
100+
I started work on the vaccum cleaner exercise. Due to how the ros native implementation is being done , i was able to get the exercise working with minimal changes. This means that most if not all exercises will be able to support ROS native implementation with minimal changes. The only hurdle will be to adapt the GUI modules for the exercises to support ROS native implementation.
101+
102+
![Vaccum Cleaner exercise ](assets/lib/week_5_vc.gif)
103+
<sub><i>Vaccum Cleaner exercise </i></sub>
104+
105+
106+
I also started work on the documentation for the vaccum cleaner exercise. The documentation is being updated to include the ROS native implementation and how to use it similar to the follow line exercise documentation. I have raised a issue and a PR for the same. Although the documentation is not complete yet, as i need some inputs from my mentors on how to implement few things for the exercise.
107+
108+
---
109+
110+
111+
### PRs & Issues Raised
112+
113+
Here are the contributions made this week:
114+
115+
**Issues**
116+
- [ROS 2 solution example](https://github.com/JdeRobot/RoboticsAcademy-solutions/issues/98) (This is a private repo)
117+
- [Vaccum cleaner exercise Docs (Ros Native)](https://github.com/JdeRobot/RoboticsAcademy/issues/3156)
118+
- [Fix logging in VNC Console](https://github.com/JdeRobot/RoboticsApplicationManager/issues/222)
119+
120+
**Pull Requests**
121+
- [Follow line ros native implementation ( using show Image)](https://github.com/JdeRobot/RoboticsAcademy-solutions/pull/100) (This is a private repo)
122+
- [initial vaccum cleaner commit](https://github.com/JdeRobot/RoboticsAcademy/pull/3157)
123+
- [Update ros-native with humble-devel changes (Week 5 sync)](https://github.com/JdeRobot/RoboticsApplicationManager/pull/230)
124+
125+
---
126+
127+
### Key Learnings & Outcomes
128+
- Successfully implemented ROS native solution for the follow line exercise
129+
- Implemented & gained insights into handling image output in the GUI and logging in the VNC Console
130+
- Vaccum cleaner exercise ROS native implementation explored
131+
- Documentation for ROS native implementation (vaccum cleaner exercise) started
132+
133+
---
134+
135+
136+
Thanks for reading! I’m excited about the progress made this week and looking forward to tackling the challenges ahead. If you have any questions or feedback, feel free to reach out!
137+
138+
Until next week —
139+
_Ashish_

0 commit comments

Comments
 (0)