lookout-config 1.4.0__py3-none-any.whl → 1.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lookout_config/generate_urdf.py +39 -46
- lookout_config/schemas/lookout.schema.json +0 -12
- lookout_config/types.py +15 -2
- {lookout_config-1.4.0.dist-info → lookout_config-1.6.0.dist-info}/METADATA +2 -2
- lookout_config-1.6.0.dist-info/RECORD +13 -0
- lookout_config-1.4.0.dist-info/RECORD +0 -13
- {lookout_config-1.4.0.dist-info → lookout_config-1.6.0.dist-info}/WHEEL +0 -0
- {lookout_config-1.4.0.dist-info → lookout_config-1.6.0.dist-info}/top_level.txt +0 -0
- {lookout_config-1.4.0.dist-info → lookout_config-1.6.0.dist-info}/zip-safe +0 -0
lookout_config/generate_urdf.py
CHANGED
@@ -1,44 +1,58 @@
|
|
1
|
-
from typing import List
|
2
1
|
from lookout_config import LookoutConfig
|
3
|
-
from greenstream_config import
|
4
|
-
from gr_urchin import URDF, Joint, Material, Link, xyz_rpy_to_matrix, Visual, Mesh, Geometry
|
2
|
+
from greenstream_config import Offsets, get_cameras_urdf
|
3
|
+
from gr_urchin import URDF, Joint, Material, Link, xyz_rpy_to_matrix, Visual, Mesh, Geometry, Box
|
5
4
|
from math import radians
|
6
5
|
|
7
6
|
|
7
|
+
def joint_from_offsets(offsets: Offsets, parent: str, child: str) -> Joint:
|
8
|
+
return Joint(
|
9
|
+
name=f"{parent}_to_{child}",
|
10
|
+
parent=parent,
|
11
|
+
child=child,
|
12
|
+
joint_type="fixed",
|
13
|
+
origin=xyz_rpy_to_matrix(
|
14
|
+
[
|
15
|
+
offsets.forward or 0.0,
|
16
|
+
offsets.left or 0.0,
|
17
|
+
offsets.up or 0.0,
|
18
|
+
offsets.roll or 0.0,
|
19
|
+
offsets.pitch or 0.0,
|
20
|
+
offsets.yaw or 0.0,
|
21
|
+
]
|
22
|
+
),
|
23
|
+
)
|
24
|
+
|
25
|
+
|
8
26
|
def generate_urdf(
|
9
27
|
config: LookoutConfig,
|
10
|
-
cameras: List[Camera],
|
11
|
-
ins_offset: Offsets,
|
12
|
-
mesh_path: str,
|
13
|
-
waterline=0.0, # meters between the waterline and the base_link
|
14
28
|
add_optical_frame: bool = True,
|
15
29
|
):
|
16
|
-
|
30
|
+
mesh_path = f"package://lookout_bringup/meshes/{config.offsets.name}"
|
17
31
|
file_path = f"/tmp/vessel_{config.mode.value}.urdf"
|
18
|
-
|
19
|
-
# generate links and joints for all vessel cameras
|
20
|
-
camera_links, camera_joints = get_cameras_urdf(
|
21
|
-
cameras, [None], add_optical_frame, namespace=config.namespace_vessel
|
22
|
-
)
|
23
|
-
namespace_prefix = f"{config.namespace_vessel}_" if config.namespace_vessel != "" else ""
|
32
|
+
camera_links, camera_joints = get_cameras_urdf(config.cameras, [], add_optical_frame) # type: ignore
|
24
33
|
|
25
34
|
urdf = URDF(
|
26
35
|
name="origins",
|
27
36
|
materials=[
|
28
|
-
Material(name="grey", color=[0.75, 0.75, 0.75,
|
29
|
-
Material(name="blue", color=[0, 0,
|
37
|
+
Material(name="grey", color=[0.75, 0.75, 0.75, 0.6]),
|
38
|
+
Material(name="blue", color=[0, 0.12, 0.25, 0.9]),
|
30
39
|
],
|
31
40
|
links=[
|
32
|
-
Link(name=
|
41
|
+
Link(name="ins", inertial=None, visuals=None, collisions=None),
|
33
42
|
Link(
|
34
|
-
name=
|
43
|
+
name="waterline",
|
44
|
+
visuals=[
|
45
|
+
Visual(
|
46
|
+
name="waterline",
|
47
|
+
geometry=Geometry(box=Box([10.0, 10.0, 0.01])),
|
48
|
+
material=Material(name="blue"),
|
49
|
+
)
|
50
|
+
],
|
35
51
|
inertial=None,
|
36
|
-
visuals=None,
|
37
52
|
collisions=None,
|
38
53
|
),
|
39
54
|
Link(
|
40
|
-
name=
|
41
|
-
inertial=None,
|
55
|
+
name="base_link",
|
42
56
|
visuals=[
|
43
57
|
Visual(
|
44
58
|
name="visual",
|
@@ -47,43 +61,22 @@ def generate_urdf(
|
|
47
61
|
),
|
48
62
|
origin=xyz_rpy_to_matrix([0, 0, 0, radians(-90), 0, 0]),
|
49
63
|
material=Material(name="grey"),
|
50
|
-
)
|
64
|
+
),
|
51
65
|
],
|
66
|
+
inertial=None,
|
52
67
|
collisions=None,
|
53
68
|
),
|
54
69
|
*camera_links,
|
55
70
|
],
|
56
71
|
joints=[
|
57
|
-
|
58
|
-
|
59
|
-
parent=f"{namespace_prefix}base_link",
|
60
|
-
child=f"{namespace_prefix}ins_link",
|
61
|
-
joint_type="fixed",
|
62
|
-
origin=xyz_rpy_to_matrix(
|
63
|
-
[
|
64
|
-
ins_offset.forward,
|
65
|
-
ins_offset.left,
|
66
|
-
ins_offset.up,
|
67
|
-
ins_offset.roll,
|
68
|
-
ins_offset.pitch,
|
69
|
-
ins_offset.yaw,
|
70
|
-
]
|
71
|
-
),
|
72
|
-
),
|
73
|
-
Joint(
|
74
|
-
name=f"{namespace_prefix}base_to_{namespace_prefix}waterline",
|
75
|
-
parent=f"{namespace_prefix}base_link",
|
76
|
-
child=f"{namespace_prefix}waterline_link",
|
77
|
-
joint_type="fixed",
|
78
|
-
origin=xyz_rpy_to_matrix([0, 0, -waterline, 0, 0, 0]),
|
79
|
-
),
|
72
|
+
joint_from_offsets(config.offsets.baselink_to_ins, "base_link", "ins"),
|
73
|
+
joint_from_offsets(config.offsets.baselink_to_waterline, "base_link", "waterline"),
|
80
74
|
*camera_joints,
|
81
75
|
],
|
82
76
|
)
|
83
77
|
|
84
78
|
urdf.save(file_path)
|
85
79
|
|
86
|
-
# stringify urdf response for robot description
|
87
80
|
with open(file_path) as infp:
|
88
81
|
robot_description = infp.read()
|
89
82
|
|
@@ -442,17 +442,6 @@
|
|
442
442
|
"title": "Password",
|
443
443
|
"type": "string"
|
444
444
|
},
|
445
|
-
"joystick_topic": {
|
446
|
-
"anyOf": [
|
447
|
-
{
|
448
|
-
"type": "string"
|
449
|
-
},
|
450
|
-
{
|
451
|
-
"type": "null"
|
452
|
-
}
|
453
|
-
],
|
454
|
-
"title": "Joystick Topic"
|
455
|
-
},
|
456
445
|
"ptz_components": {
|
457
446
|
"items": {
|
458
447
|
"$ref": "#/$defs/PTZComponent"
|
@@ -478,7 +467,6 @@
|
|
478
467
|
"port",
|
479
468
|
"username",
|
480
469
|
"password",
|
481
|
-
"joystick_topic",
|
482
470
|
"ptz_components"
|
483
471
|
],
|
484
472
|
"title": "PTZOnvif",
|
lookout_config/types.py
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
# * lookout_interfaces/msg/Config.msg
|
3
3
|
# * lookout_config_manager/mappers.py
|
4
4
|
|
5
|
-
from typing import
|
5
|
+
from typing import Optional, Any
|
6
6
|
from enum import Enum
|
7
7
|
from pydantic import BaseModel, field_validator, ConfigDict
|
8
8
|
from pydantic.fields import Field
|
9
9
|
|
10
|
-
from greenstream_config.types import Camera
|
10
|
+
from greenstream_config.types import Camera, Offsets
|
11
11
|
|
12
12
|
|
13
13
|
class Mode(str, Enum):
|
@@ -87,6 +87,12 @@ class CameraExtended(Camera):
|
|
87
87
|
return ignore_regions
|
88
88
|
|
89
89
|
|
90
|
+
class VesselOffsets(BaseModel):
|
91
|
+
name: str
|
92
|
+
baselink_to_ins: Offsets
|
93
|
+
baselink_to_waterline: Offsets
|
94
|
+
|
95
|
+
|
90
96
|
class LookoutConfig(BaseModel):
|
91
97
|
# So enum values are written and read to the yml correctly
|
92
98
|
model_config = ConfigDict(
|
@@ -110,6 +116,13 @@ class LookoutConfig(BaseModel):
|
|
110
116
|
gpu: bool = True
|
111
117
|
geolocation_mode: GeolocationMode = GeolocationMode.NONE
|
112
118
|
positioning_system: PositioningSystem = PositioningSystem.NONE
|
119
|
+
offsets: VesselOffsets = VesselOffsets(
|
120
|
+
name="mars.stl",
|
121
|
+
baselink_to_ins=Offsets(forward=1.4160, left=0.153, up=0.184),
|
122
|
+
baselink_to_waterline=Offsets(
|
123
|
+
up=0.3,
|
124
|
+
),
|
125
|
+
)
|
113
126
|
components: Any = Field(default_factory=dict)
|
114
127
|
prod: bool = True
|
115
128
|
log_directory: str = "~/greenroom/lookout/logs"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lookout_config
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.6.0
|
4
4
|
Summary: A library for reading / writing Lookout config files
|
5
5
|
Home-page: https://github.com/Greenroom-Robotics/lookout
|
6
6
|
Author: Greenroom Robotics
|
@@ -19,7 +19,7 @@ Requires-Dist: setuptools
|
|
19
19
|
Requires-Dist: dacite
|
20
20
|
Requires-Dist: PyYAML
|
21
21
|
Requires-Dist: dc-schema
|
22
|
-
Requires-Dist: greenstream-config==3.
|
22
|
+
Requires-Dist: greenstream-config==3.6.3
|
23
23
|
Requires-Dist: gr-urchin
|
24
24
|
|
25
25
|
# Lookout Config
|
@@ -0,0 +1,13 @@
|
|
1
|
+
lookout_config/__init__.py,sha256=3D-vqwfTPSuvLVBo4wiYQglpPUm4Fj6Y5MYGIS-e0fI,1738
|
2
|
+
lookout_config/generate_schemas.py,sha256=yFNvrZ6gie1tnTM_1TO8_wBa0lFHJAABSI3ZAZqw_Wg,457
|
3
|
+
lookout_config/generate_urdf.py,sha256=Emve-fVAjCT89Lz2wyyat5t3Yjxa-SdWPgnT9Pu4KPs,2723
|
4
|
+
lookout_config/helpers.py,sha256=3GkGRPDzQ67I5srwcWoI8PI1dgrWvTsUwA8-yRUttLM,603
|
5
|
+
lookout_config/launch_parameters.py,sha256=1q49Abigr6WQ3MCJtRcS-h5wQLFNW0yx-zHXOkjn3QM,180
|
6
|
+
lookout_config/types.py,sha256=RUc34rXcYp3262n9FZIBjSxft5-688A8ArDJwrqzVIU,3596
|
7
|
+
lookout_config/schemas/lookout.schema.json,sha256=wg7hK6vFLk90w4B5cCtOwYYfKMNcggli0S3c1P-vTDs,12750
|
8
|
+
lookout_config/test/lookout_config_test.py,sha256=TdOzIEWnyrckhmK7OtShtoWwSAP8QDCiKalNhvScd2U,73
|
9
|
+
lookout_config-1.6.0.dist-info/METADATA,sha256=DUxXzTbSN1xNL9V3eUm5oci-yNBwl_GsULD6SKIHyAo,1436
|
10
|
+
lookout_config-1.6.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
11
|
+
lookout_config-1.6.0.dist-info/top_level.txt,sha256=IiZRgJhNrNL87uLMQm9lQRrMCqJnTOl7aYlA7zRSYyg,15
|
12
|
+
lookout_config-1.6.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
13
|
+
lookout_config-1.6.0.dist-info/RECORD,,
|
@@ -1,13 +0,0 @@
|
|
1
|
-
lookout_config/__init__.py,sha256=3D-vqwfTPSuvLVBo4wiYQglpPUm4Fj6Y5MYGIS-e0fI,1738
|
2
|
-
lookout_config/generate_schemas.py,sha256=yFNvrZ6gie1tnTM_1TO8_wBa0lFHJAABSI3ZAZqw_Wg,457
|
3
|
-
lookout_config/generate_urdf.py,sha256=_LaBPlp6BDFP68DMxF-VQS1SDt4iX1pmb0kITQM-I9E,3103
|
4
|
-
lookout_config/helpers.py,sha256=3GkGRPDzQ67I5srwcWoI8PI1dgrWvTsUwA8-yRUttLM,603
|
5
|
-
lookout_config/launch_parameters.py,sha256=1q49Abigr6WQ3MCJtRcS-h5wQLFNW0yx-zHXOkjn3QM,180
|
6
|
-
lookout_config/types.py,sha256=2Vb4D-3gOSnurLjbSRdJjfinrSWTGCFW2szgGZRbrME,3255
|
7
|
-
lookout_config/schemas/lookout.schema.json,sha256=WK4HvtAYYUwLTV0lybj6-9FxXvQUx1ZKTgOoamSpJPA,13002
|
8
|
-
lookout_config/test/lookout_config_test.py,sha256=TdOzIEWnyrckhmK7OtShtoWwSAP8QDCiKalNhvScd2U,73
|
9
|
-
lookout_config-1.4.0.dist-info/METADATA,sha256=H4-cc7FvJIQ_bJeqRSSxlLeRsvhCrk-yR6Cu4rsi1fw,1436
|
10
|
-
lookout_config-1.4.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
11
|
-
lookout_config-1.4.0.dist-info/top_level.txt,sha256=IiZRgJhNrNL87uLMQm9lQRrMCqJnTOl7aYlA7zRSYyg,15
|
12
|
-
lookout_config-1.4.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
13
|
-
lookout_config-1.4.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|