Modifying python code for Picar-V

I have installed the picar-V (via github) software onto a raspberry pi 4 and setup a startup script for the django server in etc/rc.local on bootup. I want to make some enhancements to the python code but am unsure what source code to update. The *.py and *.pyc files seem to be scattered across multiple directories on the raspberry pi. So I am asking how to make python programing modifications and re-deploy. I am confused as to the multiple locations and copies of the various files.

Thank You


If you want to modify the content of the remote control part, you can modify

I want to add functions like sensors and I2C devices. I am trying to do this by modifying ~/SunFounder_PiCar-V/client/ Is this the correct place?

There are copies of the code scattered everywhere:

(And many more places)

When I modify SunFounder_PiCar-V/client/, it only works running in the python IDE (Thonny) and not when run as a service. I believe the actual binary is executed from some other place.

I have also checked $PATH and nothing referenced there.


To add sensors, the I2C device should be changed in ~/SunFounder_PiCar-V/remote_control/remote_control/. You can see that the run function in will run different functions under different actions. The code inside is to do the client, that is, the control page, it is not recommended to implement the sensor function on this.

OK, I did a simple test by changing the camdown action to cam.turn_up and it worked. I understand to update the to add/change actions. But if I want to write a new subroutine action and use it, or modify an existing subroutine, where do I put that NEW/Mod subroutine? Do I look in the ./driver folder?

Thank You

Not quite understand what subroutine refers to, can you give me an example? /driver is a library, that is, some relatively complex operations are abstracted out of a library and put into the driver, in order to simplify the code of the views.

I’m sorry, I wasn’t using the correct Python term. I meant writing a new class object (instead of ‘subroutine’) , like you did with the I think I have it figured out. Thank You!!!

1 Like