Minimising jerk by publishing faster than subscribing
Is there a way I could publish a node at a different rate of subscribing?
I do intend to have a python script instercept /cmd_vel and publish it 5 times faster in incrementally.
For eg:
pub = rospy.Publisher("/cmd_vel", Twist)
rospy.SUbscriber("/pre_cmd_vel")
i = 1
rate = rospy.Rate(10)
while linear.change < 5:
rate = rospy.Rate(50)
p.linear.x = i
pub.publish(p)
i = i + 1
rate.sleep()
rate = rospy.Rate(10)`
Would something like that work? SInce jerking is caused by acceleration, breaking a command for a sudden jump in velocity into smaller blocks would give less jerk?