rubu.temas module

class rubu.temas.Connect(hostname='temas', ip_address='')[source]

Bases: object

This class alows the Temas connection.

get_ip_from_hostname(hostname, max_attempts=4)[source]

Attempts to determine the IP address of the hostname.

class rubu.temas.Socket(port, ip_address='')[source]

Bases: object

This class send commands to Temas

send_cmd(command, text=False, path='')[source]

Send commands

Parameters:

command (List, optional) – A command is given

Returns:

Data of socket temas.send_cmd

Raises:

Exception

class rubu.temas.Camera(port=8081, ip_address='')[source]

Bases: object

This class allows the control of camera using urllib.

update()[source]

Continuously fetches frames from the MJPEG stream.

start_thread()[source]

Starts the thread to fetch frames.

stop_thread()[source]

Stops the thread.

get_frame()[source]

Returns the most recent frame

Returns:

Frame

Return type:

numpy.ndarray or None

set_exposure_time(microseconds)[source]

Set exposure time of visual camera 50-33000µs :return: Exposure time :rtype: String

set_brightness(brightness_percent)[source]

Set brightness of visual camera 0-100 :return: Brightness :rtype: String

set_saturation(saturation_percent)[source]

Set saturation of visual camera 0-100 :return: Saturation :rtype: String

set_contrast(contrast_percent)[source]

Set contrast of visual camera 0-100 :return: Contrast :rtype: String

set_lens_position(lens_position_percent)[source]

Set lens position of visual camera 0-100 :return: Lens position :rtype: String

set_gain(gain_value)[source]

Set gain of visual camera 1.123-16.0 :return: Gain :rtype: String

class rubu.temas.Control(port=8082, ip_address='')[source]

Bases: object

This class alows the control of motors and laser.

get_pcl(path)[source]

Retrieve the latest point cloud from the laser scan (e.g., located at C:/temp/).

Returns:

.ply file

distance()[source]

Laser distance measurment

Returns:

Value of the distance [cm]

Return type:

String

mean_distance()[source]

Mean laser distance measurement

Returns:

Value of the mean_distance [cm]

Return type:

String

move_pos(phi, theta)[source]

Move to the specified pan and tilt angles in degrees (e.g., 12.5, 11) with a step size of 0.5°.

Returns:

Status message indicating if the move was successful. Returns True if successful.

Return type:

String

get_pos()[source]

Get motor positions

Returns:

pan, tilt positions [°]

Return type:

String

move_home()[source]

Move to home position

move(direction)[source]

Sends a movement command to the motor.

move_threaded(direction)[source]

Starts the movement in a separate thread.

move_right()[source]

Move motor right in 1° steps

move_left()[source]

Move motor left in 1° steps

move_up()[source]

Move motor up in 1° steps

move_down()[source]

Move motor down in 1° steps

move_right_fine()[source]

Move motor right in 0.5° steps

move_left_fine()[source]

Move motor left in 0.5° steps

move_up_fine()[source]

Move motor up in 0.5° steps

move_down_fine()[source]

Move motor down in 0.5° steps

start_point_cloud_scan(theta1, theta2, phi1, phi2, color=1)[source]

Starts a point cloud scan between the specified pan and tilt angle ranges.

Parameters:
  • theta1 – Minimum elevation angle in degrees (-30 to 90, step size 0.5°)

  • theta2 – Maximum elevation angle in degrees (-30 to 90, step size 0.5°)

  • phi1 – Minimum azimuth angle in degrees (-60 to 60, step size 0.5°)

  • phi2 – Maximum azimuth angle in degrees (-60 to 60, step size 0.5°)

  • color – Color mode (default = 1)

Returns:

Status message indicating if the scan was started successfully. Returns True if successful.

Return type:

String

stop_point_cloud_scan()[source]

Stop point cloud scan

Returns:

Status message indicating if the scan was stopped successfully. Returns True if successful.

Return type:

String

get_point_cloud_scan_percent()[source]

Point cloud scan status in perecent

Returns:

Point cloud scan status [%]

Return type:

String

class rubu.temas.Common(port=8083, ip_address='')[source]

Bases: object

This class included the common settings of Temas

shutdown()[source]

Shutdown Temas

Returns:

Status message indicating if the shutdown was successful. Returns True if successful.

Return type:

String

restart()[source]

Restart Temas

Returns:

Status message indicating if the restart was successful. Returns True if successful.

Return type:

String

get_temperature()[source]

Read Temperature of Temas

Returns:

Temperature Temas [°C]

Return type:

String

get_ip()[source]

Get ip address of Temas

Returns:

Ip address

Return type:

String

get_sn()[source]

Get serial number of Temas

Returns:

Serial number is returned

Return type:

String

get_fw_version()[source]

Get firmware version of Temas

Returns:

Firmware version is returned

Return type:

String

get_hostname()[source]

Get hostname of Temas

Returns:

Hostname is returned

Return type:

String

set_hostname(hostname)[source]

Set hostname of Temas

get_port_camera()[source]

Get port of Temas visual camera

Returns:

Port from visual camera

Return type:

String

get_port_tof_camera()[source]

Get port of Temas tof camera

Returns:

Port from tof camera

Return type:

String

get_port_common()[source]

Get port of Temas common settings

Returns:

Port from Temas common settings

Return type:

String

get_port_control()[source]

Get port of control device

Returns:

Port from control device

Return type:

String

get_mac()[source]

Get the mac address of Temas

Returns:

Returns the mac address

Return type:

String

get_laser_x_los()[source]

Get the x value los of Laser in pixels relative to the visual frame.

Returns:

Returns the x value los (px)

Return type:

String

get_laser_y_los()[source]

Get the y value los of Laser in pixels relative to the visual frame.

Returns:

Returns the y value los

Return type:

String

set_static_ip(ip, gateway, dns)[source]

static ip /24 dhcp :param ip: IP address :param gateway: Default gateway for the network :param dns: DNS server address

set_direct_static_ip(ip)[source]

static ip /24 without dhcp :param ip: IP address

near_mode_on()[source]

tof near mode on

near_mode_off()[source]

tof near mode off