libhsrsub
Library for ROS Subscribe of HSR.
- class libhsrsub.LibHSRSub(libutil, libopencv)
Bases:
objectHSR Subscribe library for WRS simlator.
- delete()
- get_hand_image(is_cv=True)
Get hand camera images.
- Parameters
is_cv (bool, optional) – Whether to convert to OpenCV format. Defaults to True.
- Returns
- If is_cv=True, return a OpenCV image.
Returns False if the conversion fails.
sensor_msgs/Image: If is_cv=False, return a sensor_msgs/Image.
- Return type
ndarray
- get_joint_positions()
Get each joint position of the robot.
- Returns
Each joint position.
- Return type
dict[str, int]
Examples
>>> print(get_joint_positions()) {"arm_lift_joint": 0.1, "arm_flex_joint": 0.17, ...}
- subf_hand_image(hand_image)
Callback function for hand rgb image.
- Parameters
hand_image (sensor_msgs/Image) – Hand rgb image.
- subf_joint_states(joint_states)
Callback function for joint states.
- Parameters
joint_states (sensor_msgs/JointState) – Joint states.