-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simpler python import command; new opengl python demo
- Loading branch information
Showing
11 changed files
with
88 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# --------------------------------------------------------------------- | ||
# Install python3-pymrpt, ros-$ROS_DISTRO-mrpt2, or test with a local build with: | ||
# export PYTHONPATH=$HOME/code/mrpt/build-Release/:$PYTHONPATH | ||
# --------------------------------------------------------------------- | ||
|
||
from mrpt.pymrpt import mrpt | ||
import time | ||
|
||
# Create GUI: | ||
win = mrpt.gui.CDisplayWindow3D('MRPT GUI demo', 800, 600) | ||
|
||
# Get and lock 3D scene: | ||
# Lock is required again each time the scene is modified, to prevent | ||
# data race between the main and the rendering threads. | ||
scene = win.get3DSceneAndLock() | ||
|
||
# ctor args: xMin: float, xMax: float, yMin: float, yMax: float, z: float, frequency: float | ||
glGrid = mrpt.opengl.CGridPlaneXY.Create(-10, 10, -10, 10, 0, 1) | ||
scene.insert(glGrid) | ||
|
||
glCorner = mrpt.opengl.stock_objects.CornerXYZ(2.0) | ||
scene.insert(glCorner) | ||
|
||
glCorner2: mrpt.opengl.CSetOfObjects = mrpt.opengl.stock_objects.CornerXYZ(1.0) | ||
glCorner2.setLocation(4.0, 0.0, 0.0) | ||
scene.insert(glCorner2) | ||
|
||
glEllip = mrpt.opengl.CEllipsoidInverseDepth3D() | ||
cov = mrpt.math.CMatrixFixed_double_3UL_3UL_t.Zero() | ||
cov[0, 0] = 0.01 | ||
cov[1, 1] = 0.001 | ||
cov[2, 2] = 0.002 | ||
mean = mrpt.math.CMatrixFixed_double_3UL_1UL_t() | ||
mean[0, 0] = 0.2 # inv_range | ||
mean[1, 0] = 0.5 # yaw | ||
mean[2, 0] = -0.6 # pitch | ||
glEllip.setCovMatrixAndMean(cov, mean) | ||
scene.insert(glEllip) | ||
|
||
|
||
# end of scene lock: | ||
win.unlockAccess3DScene() | ||
|
||
|
||
print('Close the window to quit the program') | ||
|
||
while win.isOpen(): | ||
|
||
win.repaint() | ||
time.sleep(50e-3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
diff --git a/python/stubs-out/mrpt/pymrpt/mrpt/opengl/__init__.pyi b/python/stubs-out/mrpt/pymrpt/mrpt/opengl/__init__.pyi | ||
index 8abd014c7..d29cf054a 100644 | ||
--- a/python/stubs-out/mrpt/pymrpt/mrpt/opengl/__init__.pyi | ||
+++ b/python/stubs-out/mrpt/pymrpt/mrpt/opengl/__init__.pyi | ||
@@ -1,5 +1,7 @@ | ||
from typing import Any, ClassVar, Dict, List, Optional, Tuple | ||
|
||
+from . import stock_objects | ||
+ | ||
from typing import overload | ||
import mrpt.pymrpt.mrpt.containers | ||
import mrpt.pymrpt.mrpt.img | ||
diff --git a/python/stubs-out/mrpt/pymrpt/mrpt/poses/__init__.pyi b/python/stubs-out/mrpt/pymrpt/mrpt/poses/__init__.pyi | ||
index 09ba314ee..6d716eb80 100644 | ||
--- a/python/stubs-out/mrpt/pymrpt/mrpt/poses/__init__.pyi | ||
+++ b/python/stubs-out/mrpt/pymrpt/mrpt/poses/__init__.pyi | ||
@@ -1,5 +1,7 @@ | ||
from typing import Any, ClassVar, Dict, Tuple | ||
|
||
+from . import Lie | ||
+ | ||
from typing import overload | ||
import mrpt.pymrpt.mrpt | ||
import mrpt.pymrpt.mrpt.bayes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters