def main():
rospy.init_node('issue_com')
pub = rospy.Publisher(TRIAL_COM_TOPIC, TrialCommand, queue_size=10)
test_pub = rospy.Publisher(TEST_TOPIC, Empty, queue_size=10)
sub = rospy.Subscriber(POS_COM_TOPIC, TrialCommand, listen)
sub2 = rospy.Subscriber(RESULT_TOPIC, SampleResult, listen_report)
#sub = rospy.Subscriber('/joint_states', JointState, listen)
tc = TrialCommand()
T = 1
tc.controller = get_lin_gauss_test(T=T)
tc.T = T
tc.frequency = 20.0
# NOTE: ordering of datatypes in state is determined by the order here
tc.state_datatypes = [JOINT_ANGLES, JOINT_VELOCITIES]
tc.obs_datatypes = tc.state_datatypes
tc.ee_points = EE_SITES.reshape(EE_SITES.size).tolist()
r = rospy.Rate(1)
#while not rospy.is_shutdown():
# pub.publish(pc)
# r.sleep()
# print 'published!'
r.sleep()
test_pub.publish(Empty())
pub.publish(tc)
rospy.spin()
评论列表
文章目录