Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0237938

Browse files
Remake using Panda3D
1 parent 2647015 commit 0237938

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1168
-982
lines changed

‎dronesim.pyproj‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<SchemaVersion>2.0</SchemaVersion>
66
<ProjectGuid>{52353933-be99-4062-8b68-48454b506051}</ProjectGuid>
77
<ProjectHome />
8-
<StartupFile>dronesim\__main__.py</StartupFile>
8+
<StartupFile>examples\follow.py</StartupFile>
99
<SearchPath />
1010
<WorkingDirectory>.</WorkingDirectory>
1111
<OutputPath>.</OutputPath>
@@ -20,18 +20,23 @@
2020
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
2121
</PropertyGroup>
2222
<ItemGroup>
23-
<Compile Include="dronesim\scene\scene_flat.py" />
23+
<Compile Include="dronesim\interface\default.py" />
24+
<Compile Include="dronesim\objective\objective.py" />
25+
<Compile Include="examples\follow.py" />
26+
<Compile Include="dronesim\interface\tello.py" />
27+
<Compile Include="dronesim\physics\effect.py" />
28+
<Compile Include="dronesim\physics\physicsbase.py" />
29+
<Compile Include="dronesim\physics\simple.py" />
30+
<Compile Include="dronesim\sensor\camera.py" />
31+
<Compile Include="dronesim\sensor\motion.py" />
32+
<Compile Include="dronesim\sensor\sensor.py" />
33+
<Compile Include="dronesim\sensor\__init__.py" />
2434
<Compile Include="dronesim\simapp.py" />
25-
<Compile Include="dronesim\control.py" />
26-
<Compile Include="dronesim\objective.py" />
35+
<Compile Include="dronesim\interface\control.py" />
36+
<Compile Include="dronesim\objective\__init__.py" />
2737
<Compile Include="dronesim\physics\__init__.py" />
28-
<Compile Include="dronesim\protocol.py" />
29-
<Compile Include="dronesim\render\camera.py" />
30-
<Compile Include="dronesim\render\pygl.py" />
31-
<Compile Include="dronesim\scene\__init__.py" />
32-
<Compile Include="dronesim\render\__init__.py" />
3338
<Compile Include="dronesim\simulator.py" />
34-
<Compile Include="dronesim\stream.py" />
39+
<Compile Include="dronesim\types.py" />
3540
<Compile Include="dronesim\utils.py" />
3641
<Compile Include="dronesim\__init__.py" />
3742
<Compile Include="dronesim\__main__.py" />
@@ -40,24 +45,19 @@
4045
</ItemGroup>
4146
<ItemGroup>
4247
<Content Include=".gitignore" />
43-
<Content Include="dronesim\assets\ceramic-tiles-texture-4.jpg" />
44-
<Content Include="dronesim\assets\ceramic-tiles-texture-5.jpg" />
45-
<Content Include="dronesim\assets\loop.png" />
46-
<Content Include="dronesim\shaders\fragment.frag" />
47-
<Content Include="dronesim\shaders\vertex.vert" />
4848
<Content Include="MANIFEST.in" />
4949
<Content Include="README.md" />
5050
</ItemGroup>
5151
<ItemGroup>
5252
<Folder Include="dronesim" />
53-
<Folder Include="dronesim\assets" />
54-
<Folder Include="dronesim\scene\" />
53+
<Folder Include="dronesim\interface\" />
54+
<Folder Include="dronesim\sensor\" />
55+
<Folder Include="dronesim\objective\" />
5556
<Folder Include="dronesim\physics" />
56-
<Folder Include="dronesim\render" />
57-
<Folder Include="dronesim\shaders\" />
5857
<Folder Include="examples" />
5958
</ItemGroup>
6059
<ItemGroup>
60+
<InterpreterReference Include="Global|PythonCore|3.9" />
6161
<InterpreterReference Include="Global|VisualStudio|Work venv (Python 3.9 (64-bit))" />
6262
</ItemGroup>
6363
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />

‎dronesim/__init__.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

22
import os
3-
PACKAGE_BASE = os.path.dirname(__file__)
3+
PACKAGE_BASE = os.path.normpath(os.path.dirname(__file__))
44

55
from dronesim.simulator import DroneSimulator
6-
from dronesim.protocol import SimRPC
7-
from dronesim.control import SimulatedDroneHandler, SimulatedDroneControl
8-
from dronesim.utils import DroneState
6+
from dronesim.types import DroneState

‎dronesim/__main__.py‎

Lines changed: 13 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,20 @@
11

2-
import os
3-
import numpy as np
2+
import argparse
43

5-
import pygame
6-
import pygame.locals
7-
8-
from OpenGL import GL as gl
9-
10-
from dronesim.render import pygl
11-
12-
# Simulated drone
13-
from dronesim import DroneSimulator, DroneState, SimRPC, SimulatedDroneHandler
14-
from dronesim.utils import callevery
15-
16-
# Scene rendering
17-
from dronesim.stream import SimulatedDroneViewStreamer
18-
from dronesim.scene.scene_flat import FlatPathMapScene
4+
#Simulated drone
5+
from dronesim import DroneSimulator
6+
from dronesim.interface.default import DefaultDroneControl
197

8+
#App window
209
from dronesim.simapp import SimulatorApplication
2110

22-
class Action:
23-
data_timeout = 300
24-
data_timer = 0
25-
action_set = [0,0,0,0]
26-
27-
28-
# Drone simulator window launcher
29-
30-
def main():
31-
START_POSITION = (-0.9, 0, 0)
32-
33-
#Init application framework (mostly for GL to initialize)
34-
SimulatorApplication.AppInit()
11+
def main(args):
12+
#Simulator environment
13+
drone = DroneSimulator()
14+
droneControl = DefaultDroneControl(drone, update_enable=True)
15+
droneWindow = SimulatorApplication(droneControl)
16+
droneWindow.run()
3517

36-
#Drone simulator environment
37-
drone = DroneSimulator(START_POSITION)
38-
droneScene = FlatPathMapScene()
39-
droneWindow = SimulatorApplication(drone, droneScene)
40-
41-
drone.reset()
42-
43-
droneWindow.loop()
44-
45-
SimulatorApplication.AppDel()
46-
47-
droneAction = Action()
48-
49-
#Takeoff immediately
50-
#drone.takeoff()
51-
52-
#TODO: Object-oriented, and bind the methods below with it
53-
54-
def updateMotionVecFromBind(binding):
55-
binding['__props']['vec'] = [
56-
binding['sr']['value'] - binding['sl']['value'],
57-
binding['fw']['value'] - binding['bw']['value'],
58-
binding['au']['value'] - binding['ad']['value'],
59-
binding['rr']['value'] - binding['rl']['value']
60-
]
61-
62-
def performDroneActionFromBind(action : str, drone : DroneSimulator):
63-
if action == 'tk':
64-
drone.takeoff()
65-
elif action == 'ld':
66-
drone.land()
67-
elif action == 'rst':
68-
drone.reset()
69-
70-
#droneRenderer.render(viewport=window.get_size(), state=state)
71-
7218
if __name__ == "__main__":
73-
main()
19+
parser = argparse.ArgumentParser()
20+
main(parser.parse_args())
-417 KB
Binary file not shown.

‎dronesim/assets/loop.png‎

-361 KB
Binary file not shown.

‎dronesim/assets/models/propeller.glb‎

47.3 KB
Binary file not shown.
134 KB
Binary file not shown.
1.62 MB
Binary file not shown.

‎dronesim/assets/skybox.png‎

126 KB
Loading[フレーム]

‎dronesim/control.py‎

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /