Robotics StackExchange | Archived questions

How to save the velocity values from turtlebot3 waffle?

Hello,

i want to save last 40 values of speeds in order to feedback the speeds to predicting next speed.

so what i guessed is that the cmd_vel will be not only publisher but also subscriber.

The codes is like:

    self.speed_sub = rospy.Subscriber('/cmd_vel', Twist,
                                      self.update_speed)
    self.pub = rospy.Publisher('/cmd_vel',
                       Twist, queue_size=1)

def update_speed(self, spd):
    s=map(ord, spd.data)

Do you have an Idea how i can save the last 40 values of speed on the buffer?

Asked by huryou on 2019-12-12 10:43:48 UTC

Comments

Answers