Classes | Functions
hrl_lib::rutils Namespace Reference

Classes

class  FloatArrayListener
 Listens over ros network. More...
class  GenericListener
 Takes a normal ROS callback channel and gives it an on demand query style interface. More...
class  RateCaller
class  RateListener
 Class for registering as a subscriber to a specified topic, where the messages are of a given type. More...
class  UnresponsiveServerError

Functions

def bag_iter
 Iterator function for simplified filtered bag reading.
def bag_sel
def bag_sel_
 Select topics from a given bag.
def call_save_service
 Calls the service with the given name and given parameters and returns the output of the service.
def ignore_return
def np_to_colored_pointcloud
def np_to_pointcloud
 Converts a list of pr2_msgs/PressureState into a matrix.
def np_to_rgb_pointcloud
def pointcloud_to_np
def ros_to_dict
 Converts any ros message class into a dictionary (currently used to make PoseStamped messages picklable)
def wrap
 Used on ROS server (service provider) side to conveniently declare a function that returns nothing as a service.

Function Documentation

def hrl_lib.rutils.bag_iter (   file_name,
  topics = [] 
)

Iterator function for simplified filtered bag reading.

Works with large bags/messages.

Parameters:
file_namebag file name
topicslist of topics that you care about (leave blank to get everything)
Returns:
list of (topic_name, message, rostime)

Definition at line 137 of file rutils.py.

def hrl_lib.rutils.bag_sel (   file_name,
  topics = [] 
)

Definition at line 165 of file rutils.py.

def hrl_lib.rutils.bag_sel_ (   file_name,
  topics = [] 
)

Select topics from a given bag.

Use this only if you're dealing with small messages as not everything will fit into RAM.

Parameters:
file_namebag file name
topicslist of topics that you care about (leave blank to get everything)
Returns:
dict with each entry containing a list of [(topic_name, message, rostime), (...), ...]

Definition at line 156 of file rutils.py.

def hrl_lib.rutils.call_save_service (   service_name,
  service_def,
  params,
  filename = None 
)

Calls the service with the given name and given parameters and returns the output of the service.

Parameters:
service_namethe full name of the service to be called
paramsthe list of parameters to be passed into the service name of a pickle object to be created if not None

Definition at line 568 of file rutils.py.

Definition at line 203 of file rutils.py.

def hrl_lib.rutils.np_to_colored_pointcloud (   points_mat,
  intensity,
  frame 
)

Definition at line 86 of file rutils.py.

def hrl_lib.rutils.np_to_pointcloud (   points_mat,
  frame 
)

Converts a list of pr2_msgs/PressureState into a matrix.

Returns:
left mat, right mat, array def pressure_state_to_mat(contact_msgs): times = np.array([c.header.stamp.to_time() for c in contact_msgs]) left, right = zip(*[[list(c.l_finger_tip), list(c.r_finger_tip)] for c in contact_msgs])

left = np.matrix(left).T right = np.matrix(right).T return left, right, times

Definition at line 74 of file rutils.py.

def hrl_lib.rutils.np_to_rgb_pointcloud (   points_mat,
  intensities,
  frame 
)
Parameters:
points_mat2xn
intensities3xn
frame

Definition at line 97 of file rutils.py.

Definition at line 112 of file rutils.py.

Converts any ros message class into a dictionary (currently used to make PoseStamped messages picklable)

Parameters:
msg
Returns:
a nested dict with rospy.Time turned into normal unix time float

Definition at line 50 of file rutils.py.

def hrl_lib.rutils.wrap (   f,
  inputs = [],
  response = srv.EmptyResponse,
  verbose = False 
)

Used on ROS server (service provider) side to conveniently declare a function that returns nothing as a service.

ex. obj = YourObject() rospy.Service('your_service', YourSrv, wrap(obj.some_function, # What that function should be given as input from the request ['request_data_field_name1', 'request_data_field_name2'], # Class to use when construction ROS response response=SomeClass ))

Definition at line 188 of file rutils.py.



hrl_lib
Author(s): Cressel Anderson, Travis Deyle, Advait Jain, Hai Nguyen, Advisor: Prof. Charlie Kemp, Lab: Healthcare Robotics Lab at Georgia Tech
autogenerated on Wed Nov 27 2013 11:34:06