< 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
需要根据设定的距离与机器人实际行走的距离进行误差分析,进而修改数值来重新进行调整 。
文章插图
文章插图
文章插图
第二次标定时必须把机器人放回原位 。
原文请看:
- 脾胃虚寒可以吃向日葵吗
- Facebook全家桶挂一天,是因人为误操作?
- 无货源模式跨境外贸电商现成源码,全开源,平台搭建
- 网络/Network - TCP/IP协议栈 - 网络安全
- 基于pytorch加GPT搭建AI玩王者荣耀
- 3 区块链的分类
- 广州白云机场获ACI 2018年度全球服务最佳机场第9名
- WRF进阶:antro_emiss工具处理全球大气人为排放(EDGRA_HTTP
- 向日葵最文艺的称呼
- 【航空航天】“GIS+”应用,引领白云机场迈向精细化管理新模式