linear_speed: "+ str(self.speed))rospy.logwarn("-> move_time: "+ str(self.test_distance/self.speed))rospy.logwarn("-> cmd_topic: "+ str(sel。三轮全向ROS机器人标定( 二 )。" />

三轮全向ROS机器人标定( 二 )

< self.tolerance:self.start_test = Falseself.cmd_vel.publish(Twist())#stop the robotrospy.logwarn("Now stop move robot !")else:move_cmd.linear.x = self.speedself.cmd_vel.publish(move_cmd) #continue moveelse:#end testactual_dist = input("Please input actual distance:")linear_scale_error = float(actual_dist)/self.test_distanceself.odom_linear_scale *= linear_scale_errorrospy.logwarn("Now get new linear_scale: " + str(self.odom_linear_scale))self.print_summary()self.start_test = Trueself.x_start = self.position.xself.y_start = self.position.ydef print_summary(self):rospy.logwarn("~~~~~~Now Start Linear Speed Calibration~~~~~~")rospy.logwarn("-> test_distance: " + str(self.test_distance))rospy.logwarn("-> linear_speed: "+ str(self.speed))rospy.logwarn("-> move_time: "+ str(self.test_distance/self.speed))rospy.logwarn("-> cmd_topic: "+ str(self.cmd_topic))rospy.logwarn("-> distance_tolerance: " + str(self.tolerance))rospy.logwarn("-> linear_scale: " + str(self.odom_linear_scale))#get the current transform between the odom and base framesdef get_position(self):try:(trans, rot) = self.tf_listener.lookupTransform(self.odom_frame, self.base_frame, rospy.Time(0))except (tf.Exception, tf.ConnectivityException, tf.LookupException):rospy.logerr("lookup TF exception !")returnreturn Point(*trans)#Always stop the robot when shutting down the nodedef shutdown(self):rospy.logwarn("shutdown test node,stopping the robot")self.cmd_vel.publish(Twist())rospy.sleep(1)if __name__ == '__main__':try:CalibrateLinear()rospy.spin()except:rospy.logerr("Calibration terminated by unknown problems!")
rviz的文件.:

基本的标定数据:
以下为示例数据:test_distance: 2.0# mlinear_speed: 0.17# m/stolerance_linear: 0.005# 0.5cmlinear_scale: 1.0check_rate: 15cmd_topic: /cmd_velbase_frame: base_footprintodom_frame: odom
需要根据设定的距离与机器人实际行走的距离进行误差分析,进而修改数值来重新进行调整 。

三轮全向ROS机器人标定

文章插图

三轮全向ROS机器人标定

文章插图

三轮全向ROS机器人标定

文章插图
第二次标定时必须把机器人放回原位 。
原文请看: