zlp_viz module¶
This module contains utility classes and methods to run a projections visualizer.
-
class
z_laser_viz.zlp_viz.
ZLPVisualizer
[source]¶ Bases:
object
This class implement the functions related with projection elements.
-
cs_reference
¶ auxiliar variable to differentiate and find the origin axes and frames markers
Type: str
-
projection_start_cb
(req)[source]¶ Callback of ROS service to start projection of elements related to the active reference system on the surface.
Parameters: req (object) – trigger request ROS service object 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]
-
projection_stop_cb
(req)[source]¶ Callback of ROS service to stop projection of all elements.
Parameters: req (object) – trigger request ROS service object 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]
-
manual_define_coord_sys_cb
(req)[source]¶ Callback of ROS service to define a new reference system, stating the points coordinates manually by the user.
Parameters: req (object) – object with the necessary info to define a new coordinate system Returns: the first value in the returned tuple is a list of the user reference points T0, T1, T2, T3, the second is a bool success value and the third s an information message string Return type: tuple[list, bool, str]
-
timer_cb
(timer)[source]¶ Timer for controlling the projection pause between the reference systems’s different markers.
-
base_marker
(cs_name)[source]¶ Initialize the common and basic parameters of a marker.
Parameters: cs_name (object) – name of the reference system with which the marker is associated Returns: marker initialized Return type: object
-
coord_sys_axes
(cs_points)[source]¶ Create the origin axes markers.
Parameters: cs_points (object) – object with the x,y,z position of the reference points from the reference system Returns: the first value in the returned tuple is the x-axis marker and the second is the y-axis marker Return type: tuple[object, object]
-
coord_sys_frame
(cs_points)[source]¶ Create the frame marker.
Parameters: cs_points (object) – object with the x,y,z position of the reference points from the reference system Returns: frame marker Return type: object
-
set_coord_sys_cb
(req)[source]¶ Callback of ROS service to set the indicated reference system as ‘active reference system’.
Parameters: req (object) – object with the necessary parameters to identify a 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_coord_sys_cb
(req)[source]¶ Callback of ROS service to project reference points, origin axes and frame of the active reference system.
Parameters: req (object) – object with the necessary parameters to identify a reference 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_coord_sys_cb
(req)[source]¶ Callback of ROS service to remove a reference system.
Parameters: req (object) – object with the necessary parameters to identify a reference 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]
-
add_fig_cb
(msg)[source]¶ Callback of ROS topic to define a new projection element.
Parameters: msg (object) – object with the necessary parameters to define a new projection element
-
line_eq
(length, ang)[source]¶ Calculate points array of a new line from its parametrics equation.
Parameters: Returns: list of calculated points
Return type:
-
circle_eq
(radius, start_ang, end_ang)[source]¶ Calculate points array of a new circle or arc from its parametrics equation.
Parameters: Returns: list of calculated points
Return type:
-
oval_eq
(a, b, angle)[source]¶ Calculate points array of a new ellipse from its parametrics equation.
Parameters: Returns: list of calculated points
Return type:
-
hide_proj_elem_cb
(req)[source]¶ Callback of ROS service to hide specific projection element from active reference system.
Parameters: req (object) – object with the necessary parameters to identify a projection element 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]
-
unhide_proj_elem_cb
(req)[source]¶ Callback of ROS service to unhide specific projection element from active reference system.
Parameters: req (object) – object with the necessary parameters to identify a projection element 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_proj_elem_cb
(req)[source]¶ Callback of ROS service to remove specific figure from active reference system.
Parameters: req (object) – object with the necessary parameters to identify a projection element 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]
-
translate
(marker, dx=0, dy=0, dz=0)[source]¶ Translate marker from one position to another.
Parameters:
-
compute_step
()[source]¶ Calculate the resolution step of the active reference system.
Returns: resolution step (real dimension system {P} in mm / user dimension system {T}) Return type: float
-
quat_multiply
(q1, q0)[source]¶ Calculate the product of two quaternions.
Returns: object with the x,y,z,w values of the result quaternion Return type: object
-
scale
(marker, factor, proj_elem_params)[source]¶ Scale size of marker by redefining figure equation.
Parameters:
-
on_press
(key, marker, proj_elem_params)[source]¶ Check if the key pressed if one of the list and execute the respective tasks.
Parameters:
-
marker_from_name
(name)[source]¶ Find marker object in the markers array with the name.
Parameters: name (str) – name of the marker Returns: marker found Return type: object
-
init_keyboard_listener_cb
(msg)[source]¶ Start keyboard listener for monitoring key presses.
Parameters: msg (object) – object with the necessary parameters to identify a projection element 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]
-