{"id":24629642,"url":"https://github.com/jpvolt/fsdviewer","last_synced_at":"2025-05-07T22:21:00.670Z","repository":{"id":57432381,"uuid":"217329401","full_name":"jpvolt/fsdviewer","owner":"jpvolt","description":"simple 2d viewer for formula student driverless software","archived":false,"fork":false,"pushed_at":"2020-09-16T15:03:51.000Z","size":1520,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-15T05:35:34.198Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpvolt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-24T15:15:27.000Z","updated_at":"2024-02-20T15:02:47.000Z","dependencies_parsed_at":"2022-09-17T03:51:22.536Z","dependency_job_id":null,"html_url":"https://github.com/jpvolt/fsdviewer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpvolt%2Ffsdviewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpvolt%2Ffsdviewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpvolt%2Ffsdviewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpvolt%2Ffsdviewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpvolt","download_url":"https://codeload.github.com/jpvolt/fsdviewer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252962748,"owners_count":21832388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-25T06:13:31.408Z","updated_at":"2025-05-07T22:21:00.632Z","avatar_url":"https://github.com/jpvolt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fsdviewer\n\nsimple 2d viewer for formula student driverless software\n\nThis simple library was written to help the development of algorithms(slam and path planning).\nThe idea is simple, you can add one function to your main loop, pass a list of what you want to draw and thats it.\n\n![](imgs/img1.jpg)\n\n## Features \n\n- Draw cones(circles) in multiple colors and sizes\n- Draw Multiple Cars\n- Draw lines between cones\n- Draw lines between lines\n- Move and zoom in and out\n\n![](imgs/gif.gif)\n\n\n## Tutorial\nInstall via pip\n```bash\npip3 install fsd-viewer-jpvolt\n```\n\nImport the library\n```python\nfrom fsdviewer import viewer2d # import viewer\nfrom fsdviewer.viewer2d import Car, Cone, Line, LineMiddle # import drawable objects\n```\n\nCreate 4 lists, one for each drawable object type\n```python\nconesList = []\nlinesList = []\nmiddleLineList = []\ncarList = []\n```\nupdate the lists with what you want to draw\n```python\n### your code \nconeList.append(Cone(color='red', x=10, y=10, size=5))\n```\nAdd draw call to your main loop\n```python\n### your code ...\nwhile(true): ### your main loop\n    viewer2d.draw(conesList, linesList, middleLineList, carList)\n\n```\n\nAnd that´s it.\n\n### Creating drawable objects\n\n#### Cones\n```python\ncone = Cone(color='blue', x=10, y=10, size=5))\n```\nx, y and size are in pixels units\nAvaliable cone colors:\n- 'blue'\n- 'yellow'\n- 'orange'\n- 'green'\n- 'black'\n\n#### Lines\nLines creates lines bettween cones\n```python\nline = Line(cone1=0, cone1=2, color='red',  size=5))\n```\ncone1 and cone2 are cones index in cone lists\nAvaliable line colors:\n- 'red'\n- 'blue'\n- 'yellow'\n- 'orange'\n- 'green'\n\n#### MiddleLines\nMiddleLine creates a line bettween lines\n```python\nmline = MiddleLine(cone1=0, cone2=1,cone3=3, cone4=4 color='red',  size=5))\n```\ncone1, cone2, cone3, cone4 are cones index on cone list to be connected with line\nAvaliable line colors:\n- 'red'\n- 'blue'\n- 'yellow'\n- 'orange'\n- 'green'\n\n\n#### Cars\n```python\ncar = Car(x=10, y=10, rot=0.5, color='black')\n```\nx, y are in pixels\nrot is the rotation of the car, in radians\nAvaliable car colors:\n- 'blue'\n- 'green'\n- 'blue'","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpvolt%2Ffsdviewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpvolt%2Ffsdviewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpvolt%2Ffsdviewer/lists"}