lookout-config 1.4.0__tar.gz → 1.6.0__tar.gz

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.
Files changed (19) hide show
  1. {lookout_config-1.4.0 → lookout_config-1.6.0}/PKG-INFO +2 -2
  2. lookout_config-1.6.0/lookout_config/generate_urdf.py +83 -0
  3. {lookout_config-1.4.0 → lookout_config-1.6.0}/lookout_config/schemas/lookout.schema.json +0 -12
  4. {lookout_config-1.4.0 → lookout_config-1.6.0}/lookout_config/types.py +15 -2
  5. {lookout_config-1.4.0 → lookout_config-1.6.0}/lookout_config.egg-info/PKG-INFO +2 -2
  6. {lookout_config-1.4.0 → lookout_config-1.6.0}/lookout_config.egg-info/requires.txt +1 -1
  7. {lookout_config-1.4.0 → lookout_config-1.6.0}/setup.cfg +2 -2
  8. lookout_config-1.4.0/lookout_config/generate_urdf.py +0 -90
  9. {lookout_config-1.4.0 → lookout_config-1.6.0}/README.md +0 -0
  10. {lookout_config-1.4.0 → lookout_config-1.6.0}/lookout_config/__init__.py +0 -0
  11. {lookout_config-1.4.0 → lookout_config-1.6.0}/lookout_config/generate_schemas.py +0 -0
  12. {lookout_config-1.4.0 → lookout_config-1.6.0}/lookout_config/helpers.py +0 -0
  13. {lookout_config-1.4.0 → lookout_config-1.6.0}/lookout_config/launch_parameters.py +0 -0
  14. {lookout_config-1.4.0 → lookout_config-1.6.0}/lookout_config/test/lookout_config_test.py +0 -0
  15. {lookout_config-1.4.0 → lookout_config-1.6.0}/lookout_config.egg-info/SOURCES.txt +0 -0
  16. {lookout_config-1.4.0 → lookout_config-1.6.0}/lookout_config.egg-info/dependency_links.txt +0 -0
  17. {lookout_config-1.4.0 → lookout_config-1.6.0}/lookout_config.egg-info/top_level.txt +0 -0
  18. {lookout_config-1.4.0 → lookout_config-1.6.0}/lookout_config.egg-info/zip-safe +0 -0
  19. {lookout_config-1.4.0 → lookout_config-1.6.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lookout_config
3
- Version: 1.4.0
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.5.3
22
+ Requires-Dist: greenstream-config==3.6.3
23
23
  Requires-Dist: gr-urchin
24
24
 
25
25
  # Lookout Config
@@ -0,0 +1,83 @@
1
+ from lookout_config import LookoutConfig
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
4
+ from math import radians
5
+
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
+
26
+ def generate_urdf(
27
+ config: LookoutConfig,
28
+ add_optical_frame: bool = True,
29
+ ):
30
+ mesh_path = f"package://lookout_bringup/meshes/{config.offsets.name}"
31
+ file_path = f"/tmp/vessel_{config.mode.value}.urdf"
32
+ camera_links, camera_joints = get_cameras_urdf(config.cameras, [], add_optical_frame) # type: ignore
33
+
34
+ urdf = URDF(
35
+ name="origins",
36
+ materials=[
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]),
39
+ ],
40
+ links=[
41
+ Link(name="ins", inertial=None, visuals=None, collisions=None),
42
+ Link(
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
+ ],
51
+ inertial=None,
52
+ collisions=None,
53
+ ),
54
+ Link(
55
+ name="base_link",
56
+ visuals=[
57
+ Visual(
58
+ name="visual",
59
+ geometry=Geometry(
60
+ mesh=Mesh(filename=mesh_path, combine=False, lazy_filename=mesh_path)
61
+ ),
62
+ origin=xyz_rpy_to_matrix([0, 0, 0, radians(-90), 0, 0]),
63
+ material=Material(name="grey"),
64
+ ),
65
+ ],
66
+ inertial=None,
67
+ collisions=None,
68
+ ),
69
+ *camera_links,
70
+ ],
71
+ joints=[
72
+ joint_from_offsets(config.offsets.baselink_to_ins, "base_link", "ins"),
73
+ joint_from_offsets(config.offsets.baselink_to_waterline, "base_link", "waterline"),
74
+ *camera_joints,
75
+ ],
76
+ )
77
+
78
+ urdf.save(file_path)
79
+
80
+ with open(file_path) as infp:
81
+ robot_description = infp.read()
82
+
83
+ return robot_description
@@ -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",
@@ -2,12 +2,12 @@
2
2
  # * lookout_interfaces/msg/Config.msg
3
3
  # * lookout_config_manager/mappers.py
4
4
 
5
- from typing import List, Any
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.4.0
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.5.3
22
+ Requires-Dist: greenstream-config==3.6.3
23
23
  Requires-Dist: gr-urchin
24
24
 
25
25
  # Lookout Config
@@ -2,5 +2,5 @@ setuptools
2
2
  dacite
3
3
  PyYAML
4
4
  dc-schema
5
- greenstream-config==3.5.3
5
+ greenstream-config==3.6.3
6
6
  gr-urchin
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = lookout_config
3
- version = 1.4.0
3
+ version = 1.6.0
4
4
  url = https://github.com/Greenroom-Robotics/lookout
5
5
  author = Greenroom Robotics
6
6
  author_email = team@greenroomrobotics.com
@@ -26,7 +26,7 @@ install_requires =
26
26
  dacite
27
27
  PyYAML
28
28
  dc-schema
29
- greenstream-config==3.5.3
29
+ greenstream-config==3.6.3
30
30
  gr-urchin
31
31
  zip_safe = true
32
32
 
@@ -1,90 +0,0 @@
1
- from typing import List
2
- from lookout_config import LookoutConfig
3
- from greenstream_config import Camera, Offsets, get_cameras_urdf
4
- from gr_urchin import URDF, Joint, Material, Link, xyz_rpy_to_matrix, Visual, Mesh, Geometry
5
- from math import radians
6
-
7
-
8
- def generate_urdf(
9
- 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
- add_optical_frame: bool = True,
15
- ):
16
-
17
- 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 ""
24
-
25
- urdf = URDF(
26
- name="origins",
27
- materials=[
28
- Material(name="grey", color=[0.75, 0.75, 0.75, 1]),
29
- Material(name="blue", color=[0, 0, 1, 1]),
30
- ],
31
- links=[
32
- Link(name=f"{namespace_prefix}ins_link", inertial=None, visuals=None, collisions=None),
33
- Link(
34
- name=f"{namespace_prefix}waterline_link",
35
- inertial=None,
36
- visuals=None,
37
- collisions=None,
38
- ),
39
- Link(
40
- name=f"{namespace_prefix}base_link",
41
- inertial=None,
42
- visuals=[
43
- Visual(
44
- name="visual",
45
- geometry=Geometry(
46
- mesh=Mesh(filename=mesh_path, combine=False, lazy_filename=mesh_path)
47
- ),
48
- origin=xyz_rpy_to_matrix([0, 0, 0, radians(-90), 0, 0]),
49
- material=Material(name="grey"),
50
- )
51
- ],
52
- collisions=None,
53
- ),
54
- *camera_links,
55
- ],
56
- joints=[
57
- Joint(
58
- name=f"{namespace_prefix}base_to_ins",
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
- ),
80
- *camera_joints,
81
- ],
82
- )
83
-
84
- urdf.save(file_path)
85
-
86
- # stringify urdf response for robot description
87
- with open(file_path) as infp:
88
- robot_description = infp.read()
89
-
90
- return robot_description
File without changes
File without changes