コード例 #1
0
 def ipv4_multicast_address(self, address):
     """
     Set the sonar's IPv4 multicast address.
     \attention This is experimental
     \see GetPingMulticast
     """
     error_code = dll.BVTNetworkSettings_SetIPv4MulticastAddress(
         self._handle, (address))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
コード例 #2
0
ファイル: sonar.py プロジェクト: kaist-jisungpark/nims
 def external_hardware_trigger_enabled(self):
     """
     Queries whether hardware trigger is enabled. It is only valid for sonars equipped
     with a hardware trigger.
     """
     enabled = c_int()
     error_code = dll.BVTSonar_GetExternalHardwareTriggerEnabled(self._handle, byref(enabled))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return enabled.value > 0
コード例 #3
0
ファイル: sonar.py プロジェクト: kaist-jisungpark/nims
 def serial_number(self):
     """
     Return the serial 'number' of the sonar. The string may contain non-numeric characters.
     """
     buffer_size = 255
     buffer = create_string_buffer(buffer_size)
     error_code = dll.BVTSonar_GetSerialNumber(self._handle, buffer, buffer_size)
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return (buffer.value)
コード例 #4
0
 def get_fov(self, minAngleInDegrees, maxAngleInDegrees):
     """
     Retrieve the angular limits of the ping's field-of-view. Note that the limits
     reported represent only the minimum and maximum angles associated with any
     pixel in the FOV. It is possible (depending on sonar configuration) that not
     all pixels within the reported field-of-view are populated with data.
     """
     error_code = dll.BVTPing_GetFOV(self._handle, byref(minAngleInDegrees), byref(maxAngleInDegrees))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
コード例 #5
0
ファイル: sonar.py プロジェクト: kaist-jisungpark/nims
 def revert_factory_settings(self):
     """
     Removes all user settings stored on the sonar and reverts the unit back to
     its original factory configuration.  IP address of the unit after calling 
     this function will be 192.168.1.45, while other parameters depend on the type of
     sonar.
     """
     error_code = dll.BVTSonar_RevertFactorySettings(self._handle)
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
コード例 #6
0
 def sound_speed_override(self, meters_per_second):
     """
     When the GetImage functions are called, ignore the sound speed stored in the ping and 
     use this value instead.  
     Use the default SOUND_SPEED_OVERRIDE_OFF to use the ping's stored sound speed.  
     """
     error_code = dll.BVTImageGenerator_SetSoundSpeedOverride(
         self._handle, meters_per_second)
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
コード例 #7
0
 def image_resolution_policy(self):
     """
     Return the algorithm used to calculate image resolution.
     """
     resolutionPolicy = c_int()
     error_code = dll.BVTImageGenerator_GetImageResolutionPolicy(
         self._handle, byref(resolutionPolicy))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return resolutionPolicy.value
コード例 #8
0
 def fov_max_angle(self):
     """
     Return the maximum angle for the sonar's imaging field of view. 
     The angle is returned in degrees and referenced with respect to sonar head boresight (clockwise-positive).
     """
     angle = c_float()
     error_code = dll.BVTMagImage_GetFOVMaxAngle(self._handle, byref(angle))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return angle.value
コード例 #9
0
 def get_pixel(self, row, col):
     """
     Return the value of the pixel at (row, col)
     """
     pixel = c_ushort()
     error_code = dll.BVTMagImage_GetPixel(self._handle, row, col,
                                           byref(pixel))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return pixel.value
コード例 #10
0
 def get_pixel_range(self, row, col):
     """
     Retrieve the range (from the sonar head) of the specified pixel (in meters)
     """
     range = c_double()
     error_code = dll.BVTMagImage_GetPixelRange(self._handle, row, col,
                                                byref(range))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return range.value
コード例 #11
0
 def get_pixel_relative_bearing(self, row, col):
     """
     Retrieve the bearing relative to the sonar head of the specified pixel
     """
     bearing = c_double()
     error_code = dll.BVTMagImage_GetPixelRelativeBearing(
         self._handle, row, col, byref(bearing))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return bearing.value
コード例 #12
0
 def origin_row(self):
     """
     Retrieve the image row of the origin.
     In most cases the origin row will be outside of the image boundaries (i.e., negative). The origin is the 'location' (in pixels) of the sonar head in image plane.
     """
     row = c_int()
     error_code = dll.BVTMagImage_GetOriginRow(self._handle, byref(row))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return row.value
コード例 #13
0
 def max_range_of_pixel(self):
     """
     Return the max range (in meters) to a non-blank pixel in the image
     """
     maxRange = c_float()
     error_code = dll.BVTMagImage_GetMaxRangeOfPixel(
         self._handle, byref(maxRange))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return maxRange.value
コード例 #14
0
 def address_mode(self):
     """
     Get the method by which the sonar obtains an IP address.
     """
     mode = c_int()
     error_code = dll.BVTNetworkSettings_GetAddressMode(
         self._handle, byref(mode))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return mode.value
コード例 #15
0
 def range_profile_start_range(self):
     """
     @see BVTHead_SetTargetStartRange
     """
     start_range = c_float()
     error_code = dll.BVTImageGenerator_GetRangeProfileStartRange(
         self._handle, byref(start_range))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return start_range.value
コード例 #16
0
 def get_row(self, row):
     """
     Return a pointer to a row of pixels 
     """
     rowPointer = c_ushort()
     error_code = dll.BVTMagImage_GetRow(self._handle, row,
                                         byref(rowPointer))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return rowPointer.value
コード例 #17
0
 def sound_speed_override(self):
     """
     
     """
     meters_per_second = c_int()
     error_code = dll.BVTImageGenerator_GetSoundSpeedOverride(
         self._handle, byref(meters_per_second))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return meters_per_second.value
コード例 #18
0
 def bits(self):
     """
     Return a pointer to the entire image.
     The image or organized in Row-Major order (just like C/C++).
     """
     bitsPointer = c_ushort()
     error_code = dll.BVTMagImage_GetBits(self._handle, byref(bitsPointer))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return bitsPointer.value
コード例 #19
0
 def map_algorithm(self):
     """
     Do not use this. Experimental.
     """
     algorithm = c_int()
     error_code = dll.BVTImageGenerator_GetMapAlgorithm(
         self._handle, byref(algorithm))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return algorithm.value
コード例 #20
0
 def save_pgm(self, file_name):
     """
     Save the image in PGM (PortableGreyMap) format. http://en.wikipedia.org/wiki/Netpbm_format
     Note that few programs actually support loading a 16bit PGM. 
     A good image viewer for Windows is Irfanview: http://www.irfanview.com/ 
     Once you load a PGM, you will most likely need to tone map it or the majority of the image will appear black.
     """
     error_code = dll.BVTMagImage_SavePGM(self._handle, (file_name))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
コード例 #21
0
 def image_filter_flags(self):
     """
     Return the filter flags.  As of this version, if more than one flag is set, only the lowest-valued flag is used.
     """
     flags = c_int()
     error_code = dll.BVTImageGenerator_GetImageFilterFlags(
         self._handle, byref(flags))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return flags.value
コード例 #22
0
 def sonar_count(self):
     """
     Get the number of sonars discovered on the network.
     """
     sonar_count = c_int()
     error_code = dll.BVTSonarDiscoveryAgent_GetSonarCount(
         self._handle, byref(sonar_count))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return sonar_count.value
コード例 #23
0
 def ping_number(self):
     """
     Return the ping number (i.e., index in file).
     Ping numbers only have meaning if the ping came from a file.
     """
     number = c_int()
     error_code = dll.BVTPing_GetPingNumber(self._handle, byref(number))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return number.value
コード例 #24
0
ファイル: rangeprofile.py プロジェクト: kaist-jisungpark/nims
 def bearing_resolution(self):
     """
     Returns the resolution of the bearing (in degrees) of each RangeProfile range value. This is the difference in bearing between adjacent range values in the array.
     <br>
     """
     resolution = c_double()
     error_code = dll.BVTRangeProfile_GetBearingResolution(self._handle, byref(resolution))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return resolution.value
コード例 #25
0
ファイル: sonar.py プロジェクト: kaist-jisungpark/nims
 def get_head(self, head_num):
     """
     Retrieve a Head object from the sonar
     """
     head_ptr = c_void_p()
     error_code = dll.BVTSonar_GetHead(self._handle, head_num, byref(head_ptr))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     head = Head(self, head_ptr)
     return head
コード例 #26
0
 def range_resolution(self):
     """
     @see SetRangeResolution
     """
     resolution_in_meters = c_float()
     error_code = dll.BVTImageGenerator_GetRangeResolution(
         self._handle, byref(resolution_in_meters))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return resolution_in_meters.value
コード例 #27
0
ファイル: sonar.py プロジェクト: kaist-jisungpark/nims
 def external_hardware_trigger_output_event(self):
     """
     Only valid if the hardware trigger is configure as an output. 
     See EnableExternalHardwareTriggerOutput
     """
     triggerEvent = c_int()
     error_code = dll.BVTSonar_GetExternalHardwareTriggerOutputEvent(self._handle, byref(triggerEvent))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return triggerEvent.value
コード例 #28
0
 def range_profile_intensity_threshold(self):
     """
     @see BVTHead_SetRangeProfileThreshold
     """
     threshold = c_ushort()
     error_code = dll.BVTImageGenerator_GetRangeProfileIntensityThreshold(
         self._handle, byref(threshold))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return threshold.value
コード例 #29
0
ファイル: sonar.py プロジェクト: kaist-jisungpark/nims
 def firmware_revision(self):
     """
     Return the firmware revision of the sonar. The string may contain non-numeric characters.
     """
     buffer_size = 255
     buffer = create_string_buffer(buffer_size)
     error_code = dll.BVTSonar_GetFirmwareRevision(self._handle, buffer, buffer_size)
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return (buffer.value)
コード例 #30
0
 def dhcp_server_enabled(self):
     """
     If true the sonar will launch a DHCP server at boot.
     """
     is_enabled = c_int()
     error_code = dll.BVTNetworkSettings_GetDHCPServerEnabled(
         self._handle, byref(is_enabled))
     if (0 != error_code):
         raise sdkerror.SDKError(error_code)
     return is_enabled.value > 0