def cmmnd_JointAngles(self,joints_cmd, relative):
joints_action_client.getcurrentJointCommand('j2n6a300_')
joint_degree, joint_radian = joints_action_client.unitParser('degree', joints_cmd, relative)
try:
# print("dafuq")
positions = [float(n) for n in joint_degree]
result = joints_action_client.joint_angle_client(positions)
except rospy.ROSInterruptException:
print('program interrupted before completion')
python类ROSInterruptException()的实例源码
def cmmnd_CartesianPosition(self, pose_value, relative):
pose_action_client.getcurrentCartesianCommand('j2n6a300_')
pose_mq, pose_mdeg, pose_mrad = pose_action_client.unitParser('mq', pose_value, relative)
poses = [float(n) for n in pose_mq]
orientation_XYZ = pose_action_client.Quaternion2EulerXYZ(poses[3:])
try:
poses = [float(n) for n in pose_mq]
result = pose_action_client.cartesian_pose_client(poses[:3], poses[3:])
except rospy.ROSInterruptException:
print ("program interrupted before completion")
def cmmnd_JointAngles(self,joints_cmd, relative):
joints_action_client.getcurrentJointCommand('j2n6a300_')
joint_degree, joint_radian = joints_action_client.unitParser('degree', joints_cmd, relative)
try:
# print("dafuq")
positions = [float(n) for n in joint_degree]
result = joints_action_client.joint_angle_client(positions)
except rospy.ROSInterruptException:
print('program interrupted before completion')
def cmmnd_JointAngles(self,joints_cmd, relative):
joints_action_client.getcurrentJointCommand('j2n6a300_')
joint_degree, joint_radian = joints_action_client.unitParser('degree', joints_cmd, relative)
try:
# print("dafuq")
positions = [float(n) for n in joint_degree]
result = joints_action_client.joint_angle_client(positions)
except rospy.ROSInterruptException:
print('program interrupted before completion')
def cmmnd_CartesianPosition(self, pose_value, relative):
pose_action_client.getcurrentCartesianCommand('j2n6a300_')
pose_mq, pose_mdeg, pose_mrad = pose_action_client.unitParser('mq', pose_value, relative)
poses = [float(n) for n in pose_mq]
orientation_XYZ = pose_action_client.Quaternion2EulerXYZ(poses[3:])
try:
poses = [float(n) for n in pose_mq]
result = pose_action_client.cartesian_pose_client(poses[:3], poses[3:])
except rospy.ROSInterruptException:
print ("program interrupted before completion")
def cmmnd_JointAngles(self,joints_cmd, relative):
joints_action_client.getcurrentJointCommand('j2n6a300_')
joint_degree, joint_radian = joints_action_client.unitParser('degree', joints_cmd, relative)
try:
# print("dafuq")
positions = [float(n) for n in joint_degree]
result = joints_action_client.joint_angle_client(positions)
except rospy.ROSInterruptException:
print('program interrupted before completion')
def cmmnd_CartesianPosition(self, pose_value, relative):
pose_action_client.getcurrentCartesianCommand('j2n6a300_')
pose_mq, pose_mdeg, pose_mrad = pose_action_client.unitParser('mq', pose_value, relative)
poses = [float(n) for n in pose_mq]
orientation_XYZ = pose_action_client.Quaternion2EulerXYZ(poses[3:])
try:
poses = [float(n) for n in pose_mq]
result = pose_action_client.cartesian_pose_client(poses[:3], poses[3:])
except rospy.ROSInterruptException:
print ("program interrupted before completion")
def cmmnd_CartesianPosition(self, pose_value, relative):
pose_action_client.getcurrentCartesianCommand('j2n6a300_')
pose_mq, pose_mdeg, pose_mrad = pose_action_client.unitParser('mq', pose_value, relative)
poses = [float(n) for n in pose_mq]
orientation_XYZ = pose_action_client.Quaternion2EulerXYZ(poses[3:])
try:
poses = [float(n) for n in pose_mq]
result = pose_action_client.cartesian_pose_client(poses[:3], poses[3:])
except rospy.ROSInterruptException:
print ("program interrupted before completion")
def cmmnd_JointAngles(self,joints_cmd, relative):
joints_action_client.getcurrentJointCommand('j2n6a300_')
joint_degree, joint_radian = joints_action_client.unitParser('degree', joints_cmd, relative)
try:
# print("dafuq")
positions = [float(n) for n in joint_degree]
result = joints_action_client.joint_angle_client(positions)
except rospy.ROSInterruptException:
print('program interrupted before completion')
def cmmnd_CartesianPosition(self, pose_value, relative):
pose_action_client.getcurrentCartesianCommand('j2n6a300_')
pose_mq, pose_mdeg, pose_mrad = pose_action_client.unitParser('mq', pose_value, relative)
poses = [float(n) for n in pose_mq]
orientation_XYZ = pose_action_client.Quaternion2EulerXYZ(poses[3:])
try:
poses = [float(n) for n in pose_mq]
result = pose_action_client.cartesian_pose_client(poses[:3], poses[3:])
except rospy.ROSInterruptException:
print ("program interrupted before completion")
def cmmnd_JointAngles(self,joints_cmd, relative):
joints_action_client.getcurrentJointCommand('j2n6a300_')
joint_degree, joint_radian = joints_action_client.unitParser('degree', joints_cmd, relative)
try:
# print("dafuq")
positions = [float(n) for n in joint_degree]
result = joints_action_client.joint_angle_client(positions)
except rospy.ROSInterruptException:
print('program interrupted before completion')
def cmmnd_CartesianPosition(self, pose_value, relative):
pose_action_client.getcurrentCartesianCommand('j2n6a300_')
pose_mq, pose_mdeg, pose_mrad = pose_action_client.unitParser('mq', pose_value, relative)
poses = [float(n) for n in pose_mq]
orientation_XYZ = pose_action_client.Quaternion2EulerXYZ(poses[3:])
try:
poses = [float(n) for n in pose_mq]
result = pose_action_client.cartesian_pose_client(poses[:3], poses[3:])
except rospy.ROSInterruptException:
print ("program interrupted before completion")
def main():
rospy.init_node('mobile_robot_tracker', log_level=rospy.INFO)
rospy.loginfo("Starting tracking node...")
try:
tracker = MobileTracker()
except rospy.ROSInterruptException:
pass
rospy.spin()
def main():
rospy.init_node('system_calibrator', log_level=rospy.INFO)
rospy.loginfo("Calibration node started")
rospy.loginfo("Press 'c' to begin calibration")
try:
calibrator = SystemCalibrator()
except rospy.ROSInterruptException:
pass
rospy.spin()
def print_time(threadName, delay):
global f
global last_time
rate = rospy.Rate(10) # 10hz
while not rospy.is_shutdown():
try:
if rospy.get_time() - last_time >= 60.0:
last_time = rospy.get_time()
f.close()
f = open('log_file' + str(datetime.datetime.now()) + '.txt','w')
except rospy.ROSInterruptException:
pass
rate.sleep()
def __init__(self):
# create subscribers, timers, clients, etc.
try:
rospy.wait_for_service("/check_state_validity", timeout=5)
except ROSException:
rospy.logwarn("[check_collisions_node] Done waiting for /check_state_validity service... service not found")
rospy.logwarn("shutting down...")
rospy.signal_shutdown("service unavailable")
except ROSInterruptException:
pass
self.coll_client = rospy.ServiceProxy("check_state_validity", GetStateValidity)
self.js_sub = rospy.Subscriber("joint_state_check", numpy_msg(Float32MultiArray), self.js_cb)
self.js_pub = rospy.Publisher("collision_check", Int16, queue_size = 10)
return
def main():
rospy.init_node('check_collisions_node', log_level=rospy.INFO)
rospy.loginfo("Starting up collision checking demo node")
try:
coll_checker = CheckCollisionState()
except rospy.ROSInterruptException:
pass
rospy.spin()
def start_action_manager():
"""Runs the action manager"""
try:
action_manager = ActionManager()
action_manager.run()
except rospy.ROSInterruptException as detail:
rospy.loginfo("Handling: {}".format(detail))