This repo hosts our (Marte(llo) team) attempt at making a somewhat working and accurate replica of the 4WD ROSITA rover.
- Install CoppeliaSim from here
- Clone this repo
- Install dipendencies (
pip -r requirements.txt
)
append to <installFolder>/addOns/ZMQ remote API server.lua
the following before opening Coppelia
sim.saveImage = wrap(sim.saveImage, function(origFunc)
return function(img, res, opt, nm, q)
local ret = origFunc(img, res, opt, nm, q)
if type(ret) ~= 'string' then
ret = ''
end
return ret
end
end)
- In Coppelia, run the simulation
- Write your code in "src/main.py", and run that.
getImage()
- Will shoot a picture from the built in virtual camera and save it in apictures
folder inside the repo folder. Returns the path to which the picture was saved.scanTag(path)
- Will check any image for one or more QR Code and return values found. Meant to be used with asscanTag(getImage())
.pan(rad)
andtilt(rad)
- Pans or tilts the camera. Angle in radiants.setSpeed4W(fl, fr, bl, br, time)
- Sets the wheels' speed, respectively, front left, front right, back left, back right, for a determinted amount of time (provided in seconds as a parameter).stop()
- Sets the speed of all the wheels to 0.
Thanks to the CoppeliaSim team for providing the patch (see CoppeliaSim Forum for more details.
The reccomanded way to develop this project is by using venvs. This can be done, in Pycharm, by cloning the repository and by answering "yes" in the venv prompt.