def connect_to_ros(doctest_namespace): client = RosClient() client.run() robot = Robot(client) doctest_namespace["client"] = client doctest_namespace["robot"] = robot yield client.close()
self.get_end_effector_link_name()) print("The base link's name is '%s'" % self.get_base_link_name()) print("The base_frame is:", self.get_base_frame()) print("The robot's joints are:") for joint in configurable_joints: info = "\t* '%s' is of type '%s'" % ( joint.name, list(Joint.SUPPORTED_TYPES)[joint.type]) if joint.limit: info += " and has limits [%.3f, %.3f]" % (joint.limit.upper, joint.limit.lower) print(info) print("The robot's links are:") print([l.name for l in self.model.links]) if __name__ == "__main__": import doctest import math from compas.datastructures import Mesh from compas.datastructures import mesh_transformed from compas.geometry import Scale from compas_fab.robots.ur5 import Robot as UR5Robot from compas_fab.backends import RosClient client = RosClient() client.run() robot = UR5Robot(client) doctest.testmod(globs=globals()) client.close() client.terminate()