Package sick_ldmrs :: Module utils
[frames] | no frames]

Module utils

source code

Functions
rospy.Time
NTP64_to_ROStime(NTPtime)
Convert a 64bit NTP timestamp to rostime.Time
source code
rospy.Time
NTP64split_to_ROStime(seconds_part, fractional_part)
Convert seconds and fractional seconds to a rospy.Time object
source code
int
ROStime_to_NTP64(ROStime)
Convert rospy.Time object to a 64bit NTP timestamp
source code
int
Now_to_NTP64()
Get 64bit NTP timestamp of current system time
source code
str
bitString(integral_value, min_bits=8)
Return a string representation of a binary value
source code
Function Details

NTP64_to_ROStime(NTPtime)

source code 

Convert a 64bit NTP timestamp to rostime.Time

Parameters:
  • NTPtime (int) - 64bit NTP timestamp. high 32bits are seconds, low 32bits are fractional seconds (*2^-31)
Returns: rospy.Time
rospy.Time with seconds and nanoseconds fields initialised based on input

NTP64split_to_ROStime(seconds_part, fractional_part)

source code 

Convert seconds and fractional seconds to a rospy.Time object

Parameters:
  • seconds_part (int) - high 32 bits of NTP64 timestamp
  • fractional_part (int) - low 32 bits of NTP64 timestamp
Returns: rospy.Time
rospy.Time representation of the input

ROStime_to_NTP64(ROStime)

source code 

Convert rospy.Time object to a 64bit NTP timestamp

Parameters:
  • ROStime (rospy.Time) - timestamp
Returns: int
64bit NTP representation of the input

Now_to_NTP64()

source code 

Get 64bit NTP timestamp of current system time

Returns: int
NTP representation of current system time

bitString(integral_value, min_bits=8)

source code 

Return a string representation of a binary value

Return a string representation of a binary value, padded with zeros in the higher order bits if necessary

Parameters:
  • integral_value (int) - integer or long integer to convert to bit string
  • min_bits (int) - minimum number of bits to display in the result (pad zeros to the left if necessary)
Returns: str
ascii string containing the binary representation of the of the input value