我想问一下,机器人跟随代码里的一个问题

回复本帖可奖励3枚铜币哦! 每人最多可获奖1次!
奖池剩余3(中奖概率10%)
while not ctrl_c:
            try:
                (trans,rot) = listener.lookupTransform(follower_model_frame, model_to_be_followed_frame, rospy.Time(0))
            except (tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException):
                continue
            angular = 4 * math.atan2(trans[1], trans[0])
            linear = 0.5 * math.sqrt(trans[0] ** 2 + trans[1] ** 2)
            cmd = geometry_msgs.msg.Twist()
            if 2*linear>1:            
                    cmd.linear.x = linear*0.2
                    cmd.angular.z = -angular*0.1
            else:
                    cmd.linear.x =0
                    cmd.angular.z =0
            turtle_vel.publish(cmd)
            rate.sleep()
上面是机器人跟随的部分代码,我想问的是:
angular = 4 * math.atan2(trans[1], trans[0])
linear = 0.5 * math.sqrt(trans[0] ** 2 + trans[1] ** 2)
计算角速度和线速度时,为什么要分别 乘以4 和 0.5 ?
游客
登录后才可以回帖,登录 或者 注册