Danielle’s week 7 progress

Week 7: Braitenberg exercise, gym-duckietown simulation

07/22/2024

Today, I decided to tackle the braitenberg issue once more. I have updated the connections.py file and run “dts code workbench –sim” but when I try to open the simulator, I get a “site can’t be reached” error. This has happened a couple times. I have tried to change some values for the const and gain variables but that just prematurely stops my command from running in the terminal with an error saying “input channel not ready after 3 seconds. Will retry” and it just stops. I am trying to first work with the same values for const and gain variable in agent.py and then adding a few more tweaks to connections.py to see if it will work.

7/23/2024

The braitenberg exercise is perhaps a bit more complicated than intended. We are supposed to tweak the values in the connections.py file but it is a bit strange since you will have to keep testing out numbers until it works and there are a lot of possibilities. I was able to figure out some specific numbers that worked and that did the trick but they are constants and will forever produce the same result. I did not change values for const and gain in agent.py because when I did that, I got an error. Tweaking just the connections.py file will get the simulator running for now. When you run the command, you should see something like this:

and with this you should immediately click the link which will take you to a site where the simulation will begin to work. It will look like this(left side) and after a while it will look like this(right side) when the duckiebot comes into contact with a duck. This is because it crashes and this is where I get the “site can’t be reached” error. I have to keep fine tuning the numbers in the connections.py file to make sure it runs longer.

I have tried running the code on skyduck as well as suggested in the READme of the braitenberg exercise and it seems to work with skyduck but I did not have enough ducks in the way to see If it was going to actually try to avoid them. I started of with just 1 duck and skyduck kept going in circles but when I increased the number of ducks around skyduck to 4, it seemed to swerve one duck but I need to have the more ducks laid out like the image above and then run the workbench once more to see if it actually works.

7/24/2024

Today, I am working on making the gym-duckietown simulation work. It took a lot of steps and thanks to my lab mate who was able to figure out that some code related to numpy was outdated so it was changed and now I have been able to run the simulator and move around with the arrow keys.

The steps needed are:

  1. Go to duckietown simulation and then follow the steps to create a new environment in simulation
  2. cd into gym-duckietown
  3. Activate the environment
  4. Switch branch from daffy to master
  5. Install pillow and downgrade pyglet from current version to 1.5.11(it is more stable for now)
  6. Hopefully the simulator.py file will be updated and you would not need to make changes to it like I did
  7. Now you can proceed to making the python file as instructed in the simulation document and then moving in the simulation

You should have an output like this and then you can use your arrow keys to move around.

Now that I have been able to run the simulation, the next step is to go through the developer manual and the code on the gym duckietown GitHub to get a better understanding of what exactly is available and what I need to do next. Start and goal for the environment? so the precomputed thing. do eDx for planning and do work on the simulator(8 and 9 planning strategy). plan a robot with 6 degrees of freedom(front and back and rotation). when you create a sample, it should be for all the agents but you are just using 1. guide decoupled algorithms

Today we also had our reviews with Diane about the papers we read and the paper I read was very interesting –  A Complete Algorithm for a Moving Target Traveling Salesman Problem with Obstacles – and what amazed me about this paper was that it was the first of it’s kind in terms of a complete algorithm which was evident in the experiments and the video showing the experiment. After we discussed our goals for the following week which is to implement and run a planning strategy in the simulation and on the duckiebot.

7/25/2024

I am not giving up on the braitenberg exercise. I realized that I did the preprocessing in the braitenberg exercise two wrong. I had to outline the duck but I outlined the nose only and everything else was black. I reckon that may have been the reason why my agent kept crashing in the first few seconds or why I had the “site not found” error because it crashes right when the simulation starts. I re-did the preprocessing.py file where I adjusted the HSV values and also the methods in the connections.py file for the left and right motors and that it seems to be working a bit better now. Adjusting the const and gain values in agent.py is also helping with the movement of the agent which is good but still a bit tricky since the simulation changes everything and does not work as perfectly even with the constant tuning to the values. I have submitted this exercise after working on some more fine tuning for the const and gain values in agent.py

I also started the edX course chapter 7 which delves into planning I and I am hoping to do the exercise that comes with it. This chapter and the next chapter which is planning II will help with the goal of having the simulation running and having a start and goal for the duckiebot to be directed to.

7/26/2024

Today, I finished watching the planning I video and I have moved on to the exercise. For this exercise, we are to check if a robot collides with an obstacle(the environment). This involves decomposing the idea into smaller bits. If a part of the robot collides with the environment then it means that the robot as a whole has collided with the environment and false otherwise. The exercise aims to introduce us to how planning is achieved for motion planning and so far, I understand the concept and moving on to the implementation of the code. Unfortunately, there is no simulator for me to check if what I have is right or is even heading into the right direction :(. Checking for a collision between rectangle and rectangle where one is the environment and the other is the robot has proven to be very difficult. There are many surfaces the rectangle can have – left, right, up, down and the corners so I had to implement methods to cater for those.

Leave a Reply

Your email address will not be published.

Name *
Email *
Website