Autograder failing for not using /scan in the topics_quiz project

Good evening,

I have normally finished the topics_quiz but the autograder fails saying that I am not using the topic /scan in my subscriber which I think I do.

You can find 4 screenshots of my project attached. What do you think is the problem ?

Thank you in advance for the help,

What’s your node name? It should be topics_quiz_node

It was not indeed so I corrected that but it did not change the behaviour of the autograder.

Please find below my code of the subscriber and in screenshot the node created.

Also I have reached the 5 trials on the autograder. Is it possible to reset it or something ? my code is working fine…

ExploreWorld::ExploreWorld() : Node("topics_quiz_node") {
  scanSubscriber_ = std::make_shared<ScanSubscriber>();
  moveRobot_ = std::make_shared<MoveRobot>();
}

Thank you in advance,
Adrien

Hi,

So I just realised that I have 3 nodes and only one of them was named “topics_quiz_node” and not the one using the /scan topic. Maybe this is the problem so I named the 3 of them “topics_quiz_node” (which I don’t think it is a good way to go) but now I can not run the autograder again.

What do you think ? Is it possible to reset it please ?

Thanks in advance,

Adrien

are you launching those three different nodes in topics_quiz.launch.py? or better use a single node for all the functionalities.

If you didn’t see the solution then you can get a few more attempts to continue the test. @bayodesegun can you help him.

Hi,

Thanks for your reply. I shared my git repo under this link:

https://gitlab.com/adluthi/theconstruct-ros2-basics-cpp/

It will be easier I guess. But yes I am launching the 3 nodes with topics_quiz.launch.py since I have only one launch file.

Please tell me what you think. My code follows the following architecture & logic:

I have 3 classes:

  1. MoveRobot: contains the publisher to /vel_cmd
  2. ScanSubscruber: contains the subscriber to /scan
  3. ExploreWorld: contains a shared pointer of each object of the classes above and spins each node in a single thread. A third thread launched a collisionAvoidance function that gets the scan values of the scanSubscribers, sets the velocity following the logic needed to avoid an object and sets the velocities inside moveRobot through a setter.

Tell me what you think but it is working pretty well so I don’t see why I should change anything, but happy to have any input.

Thanks in advance !

I have assigned you 2 more tries. You should be able to submit again.

Not sure if your setup will work (you can try submitting again to find out), but the recommended is to do everything within a single.

Hi bayodesegun,

Thank you for having assigned 2 more tries. I have obtained 10/10 now and renaming the 3 nodes with the same name worked!

However, why it is better to check only 3 laser dots (left, front and right) instead of defining a percentage of the laser dots for each direction (i.e the 45% of the laser dot starting on the left are checked for any obstacles, then 10% of the dots on the front and the 45% remaining on the right ?

Checking only 3 dots is dangerous and make the collision avoidance system failing in case of a high convex object.

Am I missing something ?

Also based on the theorie (see picture), each node should be assign to a single module. The example even explicitly says that we should have different node for controlling the wheel motors, reading the laser values (i.e the exercise). Maybe you should consider to change the autograder.

Thank you a lot for your support,

Cheers,

Good job!

For this simple case, checking 3 dots should be enough, but it’s not necessarily better than your solution, which might be more accurate in high convex objects.

This might apply in a more complex system.

Using a single node for the topics quiz is good enough, but not better than using multiple nodes (which is also fine).

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