Chapter 5 issues with gradebot

Three issues found:

  1. Before starting last step for measuring if distance is correct, gradebot should return robot to initial place first. I had robot close to wall and it crashed it.
  2. I checked my calculations manually, it is all fine. Still last step that checks calculations is shown as incorrect.
  3. 2 times out of 5 step that checks feedback was failing - but was ok, when i resubmitted exactly same code without modifications.

Btw the solution includes rclpy.spin_once(self) in callback that results in action server not being able to receive a second request. It was discussed in one of other threads here, that this is a bad solution.

I suggest amending course with some basics about multi threading and callback groups, otherwise a newbie like me will be really struggling to pass quiz.

Hi @grif ,

Welcome to this Community!

The ROS2 Basics in 5 Days Galactic (Python) course does not introduce Multi threading and callback groups. You can find those topics on Advanced ROS2 course. But, as a person who has completed that course (myself), I am 100% sure that you can complete that course without using Multi Threading and Callback Groups. I have solved all the quizzes (topics, services, and actions) without using multi threading and callback group concepts.

Even I used rclpy.spin_once(self) in my program and it worked well. So I am sure that you can make it work.

Regards,
Girish

Hi Girish,

The problem with this method is that it works only once - looks like if you call spin_once inside of callback, then the main spin stops working. If you call action again, it wont work without restarting action server - when I faced that behavior I decided it’s a wrong solution. In this thread for same issue you recommended to use callback groups yourself - too bad i found your post only after I found that myself in official documentation.
https://get-help.robotigniteacademy.com/t/cant-retrieve-data-from-odom-topic/20315/5

So, I do not think there is a correct way of solving this quiz without callback groups.

I’d like to hear from admins, because my distance calculations are correct (checked manually) and i use same formula as provided solution. Still gradebot says it is wrong - I want to understand why.

Hi @grif ,

Yes, you are correct and I agree with you. Also, I do remember that post (the link you referenced).
Your observation that the server works only once and needs to be restarted is also correct.

But I was just telling this as a way to finish the quiz, from the scope of the chapters. This course has not introduced the Callback group concepts, so with that in mind I told you that this will work.

But yes, again, I agree with you (and from my own actual words from the post) that using callback groups will be a better way to do this. And yes, it is also the “correct” way!

I am glad you have found out my post !

Summary: If you want to finish the quiz, you can do it using the spin_once function and still be fine. But the correct way is to use callback groups.

Regards,
Girish

Hello @grif and @girishkumar.kannan ,

I’ve just done some modifications to the correction script. Could you please try to correct it again? I just tested with your action packages and I got a 10.

Also, I totally agree with your comments w.r.t adding multithreading and callback groups to the course. This is something that we will do for sure in the close future. We already had several discussions about this, but it needs to be planned thoroughly before being implemented.

Thanks for the feedback.

1 Like

Hi,

I am also stuck at the end of lection 5. I can publisch the cmd_vel and do the goal_handles’s in the execution loop and but I can not read with a second callback the odometry values. I also tried with lambda call but that is only executed after the callback for the ros2 action.

Any additional hint how to actually implement the execution callback with proper readings of a topic without wired multi thread or callback groups ?

Many Thanks

Hi @vkuehn ,

I don’t think you need to complicate your program by using lambda functions.

Just define odometry callback the usual way.
Inside the execute callback use rclpy.spin_once(self). Here self keyword is very important as you will/should define your action server as a Nodelet (inherited from Node class).

Yes, you can. With the spin_once function mentioned above.

I think you mean “weird”.

Regards,
Girish

Hi @girishkumar.kannan ,

that did actually work, just did not follow all the conversations.
Can’t mark it as a solution as it is not to the original question but kudos for you support here in the forum !!

and yes weired :wink:

Regards,
Volker

1 Like

Hi @albertoezquerro

Thanks for fixing the script. Looks like I can’t resubmit the quiz, because I reviewed the solution already. Can this be reset for me, so that i can submit my solution again?

Hello @grif ,

Just reset your quiz, you should be able to send it again now.

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