zlp_coordinate_system module¶
This module contains utility classes and methods which ease the management and operation of reference systems.
-
class
z_laser_zlp1.zlp_coordinate_system.
CoordinateSystem
(projector_id, module_id, thrift_client)[source]¶ Bases:
object
This class implement the functions related with coordinate systems management.
Parameters: -
coordinate_system_list
()[source]¶ Get list of defined coordinate systems from projector.
Returns: the first value in the returned tuple is a names’ list of available coordinate systems, the second is a bool success value and the third value in the tuple is an information message string Return type: tuple[list, bool, str]
-
create_reference_object
()[source]¶ Generate new reference object.
Returns: reference object struct fields initialized Return type: object
-
create_reference_point
(name, x, y, z=0, active=True)[source]¶ Generate new reference point.
Parameters: Returns: reference point struct fields initialized
Return type:
-
define_cs
(cs, do_target_search)[source]¶ Generate new coordinate system.
Parameters: Returns: the first value in the returned tuple is a bool success value, the second is an information message string and the third value an object with the properties of the new coordinate system defined
Return type:
-
update_cs
(cs, scan_result)[source]¶ Update coordinate system with the results of scanned targets.
Parameters: Returns: object with the updated parameters of the coordinate system
Return type:
-
function_module_changed_callback
(module_id, old_state, new_state)[source]¶ Callback for function module state change, events handler. It is used for stopping running code while until the projector ends scanning targets.
Parameters:
-
scan_targets
(ref_obj_name)[source]¶ Projector automatic scanning of the targets placed on the projection surface.
Parameters: ref_obj_name (str) – object with the necessary parameters to create the coordinate system Returns: the first value in the returned tuple is a bool success value, the second value is an information message string and the third is a list with the results of the scanned targets Return type: tuple[bool, str, list]
-
register_cs
(cs_name)[source]¶ Register a new coordinate system at the projector after it has been defined.
Parameters: cs_name (str) – name of the coordinate system Returns: the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string Return type: tuple[bool, str]
-
set_cs
(cs_name)[source]¶ Activate the new defined coordinate system and deactivate the other existing coordinate systems at the projector.
Parameters: cs_name (str) – name of the new coordinate system Returns: the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string Return type: tuple[bool, str]
-
show_cs
(cs_name)[source]¶ Project a coordinate system on the projection surface.
Parameters: cs_name (str) – name of the coordinate system Returns: the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string Return type: tuple[bool, str]
-
hide_cs
(cs_name)[source]¶ Project a coordinate system on the projection surface.
Parameters: cs_name (str) – name of the coordinate system Returns: the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string Return type: tuple[bool, str]
-
remove_cs
(cs_name)[source]¶ Delete a coordinate system.
Parameters: cs_name (str) – name of the coordinate system Returns: the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string Return type: tuple[bool, str]
-
get_cs
(cs_name, cs_params)[source]¶ Get the parameters values of a defined coordinate system.
Parameters: cs_name (str) – name of the coordinate system Returns: the first value in the returned tuple is an object with the coordinate system parameters values, the second is a bool success value and the third value in the tuple is an information message string Return type: tuple[object, bool, str]
-
_CoordinateSystem__define_reference_point
(reference_object, cross_size, n, d, x, y)¶ Fill other fields of the coordinate system object.
Parameters: - reference_object (object) – object of the coordinate system
- cross_size (object) – object with the dimensions of the crosses
- n (int) – vector index
- d (float) – distance between the projection surface and the projector
- x (float) – value of the x-axis coordinate
- y (float) – value of the y-axis coordinate
Returns: parameters of the coordinate system object updated
Return type:
-