def cmmnd_FingerPosition(self, finger_value):
commands.getoutput('rosrun kinova_demo fingers_action_client.py j2n6a300 percent -- {0} {1} {2}'.format(finger_value[0],finger_value[1],finger_value[2]))
# fingers_action_client.getCurrentFingerPosition('j2n6a300_')
#
# finger_turn, finger_meter, finger_percent = fingers_action_client.unitParser('percent', finger_value, '-r')
# finger_number = 3
# finger_maxDist = 18.9/2/1000 # max distance for one finger in meter
# finger_maxTurn = 6800 # max thread turn for one finger
#
# try:
# if finger_number == 0:
# print('Finger number is 0, check with "-h" to see how to use this node.')
# positions = [] # Get rid of static analysis warning that doesn't see the exit()
# exit()
# else:
# positions_temp1 = [max(0.0, n) for n in finger_turn]
# positions_temp2 = [min(n, finger_maxTurn) for n in positions_temp1]
# positions = [float(n) for n in positions_temp2]
#
# print('Sending finger position ...')
# result = fingers_action_client.gripper_client(positions)
# print('Finger position sent!')
#
# except rospy.ROSInterruptException:
# print('program interrupted before completion')
python类ROSInterruptException()的实例源码
task_stacking_blocks.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 20
收藏 0
点赞 0
评论 0
def cmmnd_FingerPosition(self, finger_value):
commands.getoutput('rosrun kinova_demo fingers_action_client.py j2n6a300 percent -- {0} {1} {2}'.format(finger_value[0],finger_value[1],finger_value[2]))
# fingers_action_client.getCurrentFingerPosition('j2n6a300_')
#
# finger_turn, finger_meter, finger_percent = fingers_action_client.unitParser('percent', finger_value, '-r')
# finger_number = 3
# finger_maxDist = 18.9/2/1000 # max distance for one finger in meter
# finger_maxTurn = 6800 # max thread turn for one finger
#
# try:
# if finger_number == 0:
# print('Finger number is 0, check with "-h" to see how to use this node.')
# positions = [] # Get rid of static analysis warning that doesn't see the exit()
# exit()
# else:
# positions_temp1 = [max(0.0, n) for n in finger_turn]
# positions_temp2 = [min(n, finger_maxTurn) for n in positions_temp1]
# positions = [float(n) for n in positions_temp2]
#
# print('Sending finger position ...')
# result = fingers_action_client.gripper_client(positions)
# print('Finger position sent!')
#
# except rospy.ROSInterruptException:
# print('program interrupted before completion')
def cmmnd_FingerPosition(self, finger_value):
commands.getoutput('rosrun kinova_demo fingers_action_client.py j2n6a300 percent -- {0} {1} {2}'.format(finger_value[0],finger_value[1],finger_value[2]))
# fingers_action_client.getCurrentFingerPosition('j2n6a300_')
#
# finger_turn, finger_meter, finger_percent = fingers_action_client.unitParser('percent', finger_value, '-r')
# finger_number = 3
# finger_maxDist = 18.9/2/1000 # max distance for one finger in meter
# finger_maxTurn = 6800 # max thread turn for one finger
#
# try:
# if finger_number == 0:
# print('Finger number is 0, check with "-h" to see how to use this node.')
# positions = [] # Get rid of static analysis warning that doesn't see the exit()
# exit()
# else:
# positions_temp1 = [max(0.0, n) for n in finger_turn]
# positions_temp2 = [min(n, finger_maxTurn) for n in positions_temp1]
# positions = [float(n) for n in positions_temp2]
#
# print('Sending finger position ...')
# result = fingers_action_client.gripper_client(positions)
# print('Finger position sent!')
#
# except rospy.ROSInterruptException:
# print('program interrupted before completion')
def cmmnd_FingerPosition(self, finger_value):
commands.getoutput('rosrun kinova_demo fingers_action_client.py j2n6a300 percent -- {0} {1} {2}'.format(finger_value[0],finger_value[1],finger_value[2]))
# fingers_action_client.getCurrentFingerPosition('j2n6a300_')
#
# finger_turn, finger_meter, finger_percent = fingers_action_client.unitParser('percent', finger_value, '-r')
# finger_number = 3
# finger_maxDist = 18.9/2/1000 # max distance for one finger in meter
# finger_maxTurn = 6800 # max thread turn for one finger
#
# try:
# if finger_number == 0:
# print('Finger number is 0, check with "-h" to see how to use this node.')
# positions = [] # Get rid of static analysis warning that doesn't see the exit()
# exit()
# else:
# positions_temp1 = [max(0.0, n) for n in finger_turn]
# positions_temp2 = [min(n, finger_maxTurn) for n in positions_temp1]
# positions = [float(n) for n in positions_temp2]
#
# print('Sending finger position ...')
# result = fingers_action_client.gripper_client(positions)
# print('Finger position sent!')
#
# except rospy.ROSInterruptException:
# print('program interrupted before completion')
def run(self):
rate = rospy.Rate(5.0)
while not rospy.is_shutdown():
try:
#listener("Game_MAKI")
if self.key == True:
print 'last_msg', self.last_msg
print 'current_msg', self.current_msg
print 'task', self.task, self.colorTask
#dm = RobotManager()
###working area April 6th
for elem in self.task:
self.dm.say(elem, wait = True)
self.task = []
self.last_msg = self.current_msg
self.lastColor = self.currentColor
self.key = False
###
except rospy.ROSInterruptException:
pass
rate.sleep()
def start_return_calculator(time_scale,
GVF,
num_features,
features_to_use,
behavior_policy,
target_policy):
try:
return_calculator = ReturnCalculator(time_scale,
GVF,
num_features,
features_to_use,
behavior_policy,
target_policy)
return_calculator.run()
except rospy.ROSInterruptException as detail:
rospy.loginfo("Handling: {}".format(detail))
def start_learning_foreground(time_scale,
GVFs,
topics,
policy,
stats,
control_gvf=None,
cumulant_counter=None,
reset_episode=None,
custom_stats=None):
"""Function to call with multiprocessing or multithreading.
"""
try:
foreground = LearningForeground(time_scale,
GVFs,
topics,
policy,
stats,
control_gvf,
cumulant_counter,
reset_episode)
foreground.run()
except rospy.ROSInterruptException as detail:
rospy.loginfo("Handling: {}".format(detail))
def main():
import signal
rospy.init_node('uwb_multi_range_node')
u = UWBMultiRange()
def sigint_handler(sig, _):
if sig == signal.SIGINT:
u.stop()
signal.signal(signal.SIGINT, sigint_handler)
try:
u.exec_()
except (rospy.ROSInterruptException, select.error):
rospy.logwarn("Interrupted... Stopping.")
def main():
import signal
rospy.init_node('uwb_tracker_node')
u = UWBTracker()
def sigint_handler(sig, _):
if sig == signal.SIGINT:
u.stop()
signal.signal(signal.SIGINT, sigint_handler)
try:
u.exec_()
except (rospy.ROSInterruptException, select.error):
rospy.logwarn("Interrupted... Stopping.")
def main():
import signal
rospy.init_node('uwb_multi_range_node')
u = UWBMultiRange()
def sigint_handler(sig, _):
if sig == signal.SIGINT:
u.stop()
signal.signal(signal.SIGINT, sigint_handler)
try:
u.exec_()
except (rospy.ROSInterruptException, select.error):
rospy.logwarn("Interrupted... Stopping.")
def main():
import signal
rospy.init_node('uwb_tracker_node')
u = UWBTracker()
def sigint_handler(sig, _):
if sig == signal.SIGINT:
u.stop()
signal.signal(signal.SIGINT, sigint_handler)
try:
u.exec_()
except (rospy.ROSInterruptException, select.error):
rospy.logwarn("Interrupted... Stopping.")
2017_Task1.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 17
收藏 0
点赞 0
评论 0
def cmmnd_CartesianPosition(self, pose_value, relative):
pose_action_client.getcurrentCartesianCommand('j2n6s300_')
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")
2017_Task1.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 15
收藏 0
点赞 0
评论 0
def cmmnd_JointAngles(self,joints_cmd, relative):
joints_action_client.getcurrentJointCommand('j2n6s300_')
joint_degree, joint_radian = joints_action_client.unitParser('degree', joints_cmd, relative)
try:
positions = [float(n) for n in joint_degree]
result = joints_action_client.joint_angle_client(positions)
except rospy.ROSInterruptException:
print('program interrupted before completion')
2017_Task9.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 19
收藏 0
点赞 0
评论 0
def cmmnd_CartesianPosition(self, pose_value, relative):
'''
Commands the arm in cartesian position mode. Server client
interface from kinova api.
'''
pose_action_client.getcurrentCartesianCommand('j2n6s300_')
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")
2017_Task9.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 20
收藏 0
点赞 0
评论 0
def cmmnd_JointAngles(self,joints_cmd, relative):
'''
Commands the arm in joint position mode. Server client
interface from kinova api.
'''
joints_action_client.getcurrentJointCommand('j2n6s300_')
joint_degree, joint_radian = joints_action_client.unitParser('degree', joints_cmd, relative)
try:
positions = [float(n) for n in joint_degree]
result = joints_action_client.joint_angle_client(positions)
except rospy.ROSInterruptException:
print('program interrupted before completion')
2017_Task6.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 17
收藏 0
点赞 0
评论 0
def cmmnd_CartesianPosition(self, pose_value, relative):
pose_action_client.getcurrentCartesianCommand('j2n6s300_')
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")
2017_Task2.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 16
收藏 0
点赞 0
评论 0
def cmmnd_CartesianPosition(self, pose_value, relative):
pose_action_client.getcurrentCartesianCommand('j2n6s300_')
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")
2017_Task2.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 16
收藏 0
点赞 0
评论 0
def cmmnd_JointAngles(self,joints_cmd, relative):
joints_action_client.getcurrentJointCommand('j2n6s300_')
joint_degree, joint_radian = joints_action_client.unitParser('degree', joints_cmd, relative)
try:
positions = [float(n) for n in joint_degree]
result = joints_action_client.joint_angle_client(positions)
except rospy.ROSInterruptException:
print('program interrupted before completion')
2017_Task10.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 16
收藏 0
点赞 0
评论 0
def cmmnd_CartesianPosition(self, pose_value, relative):
pose_action_client.getcurrentCartesianCommand('j2n6s300_')
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")
2017_Task10.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 15
收藏 0
点赞 0
评论 0
def cmmnd_JointAngles(self,joints_cmd, relative):
joints_action_client.getcurrentJointCommand('j2n6s300_')
joint_degree, joint_radian = joints_action_client.unitParser('degree', joints_cmd, relative)
try:
positions = [float(n) for n in joint_degree]
result = joints_action_client.joint_angle_client(positions)
except rospy.ROSInterruptException:
print('program interrupted before completion')
2017_Task5.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 17
收藏 0
点赞 0
评论 0
def cmmnd_CartesianPosition(self, pose_value, relative):
'''
Commands the arm in cartesian position mode. Server client
interface from kinova api.
'''
pose_action_client.getcurrentCartesianCommand('j2n6s300_')
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")
2017_Task4.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 16
收藏 0
点赞 0
评论 0
def cmmnd_CartesianPosition(self, pose_value, relative):
'''
Commands the arm in cartesian position mode. Server client
interface from kinova api.
'''
pose_action_client.getcurrentCartesianCommand('j2n6s300_')
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")
2017_Task4.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 21
收藏 0
点赞 0
评论 0
def cmmnd_JointAngles(self,joints_cmd, relative):
'''
Commands the arm in joint position mode. Server client
interface from kinova api.
'''
joints_action_client.getcurrentJointCommand('j2n6s300_')
joint_degree, joint_radian = joints_action_client.unitParser('degree', joints_cmd, relative)
try:
positions = [float(n) for n in joint_degree]
result = joints_action_client.joint_angle_client(positions)
except rospy.ROSInterruptException:
print('program interrupted before completion')
2017_Task7.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 22
收藏 0
点赞 0
评论 0
def cmmnd_CartesianPosition(self, pose_value, relative):
pose_action_client.getcurrentCartesianCommand('j2n6s300_')
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")
2017_Task7.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 19
收藏 0
点赞 0
评论 0
def cmmnd_JointAngles(self,joints_cmd, relative):
joints_action_client.getcurrentJointCommand('j2n6s300_')
joint_degree, joint_radian = joints_action_client.unitParser('degree', joints_cmd, relative)
try:
positions = [float(n) for n in joint_degree]
result = joints_action_client.joint_angle_client(positions)
except rospy.ROSInterruptException:
print('program interrupted before completion')
2017_Task3.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 16
收藏 0
点赞 0
评论 0
def cmmnd_CartesianPosition(self, pose_value, relative):
pose_action_client.getcurrentCartesianCommand('j2n6s300_')
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")
2017_Task8.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 18
收藏 0
点赞 0
评论 0
def cmmnd_CartesianPosition(self, pose_value, relative):
pose_action_client.getcurrentCartesianCommand('j2n6s300_')
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")
2017_Task8.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 19
收藏 0
点赞 0
评论 0
def cmmnd_JointAngles(self,joints_cmd, relative):
joints_action_client.getcurrentJointCommand('j2n6s300_')
joint_degree, joint_radian = joints_action_client.unitParser('degree', joints_cmd, relative)
try:
positions = [float(n) for n in joint_degree]
result = joints_action_client.joint_angle_client(positions)
except rospy.ROSInterruptException:
print('program interrupted before completion')
task_stacking_blocks.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 18
收藏 0
点赞 0
评论 0
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")
task_stacking_blocks.py 文件源码
项目:cu-perception-manipulation-stack
作者: correlllab
项目源码
文件源码
阅读 22
收藏 0
点赞 0
评论 0
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')