mirror of
https://github.com/SHC-ASTRA/rover-ros2.git
synced 2026-04-20 11:51:16 -05:00
fix(headless): correctly scale cmd_vel values
This commit is contained in:
@@ -366,10 +366,14 @@ class Headless(Node):
|
|||||||
) # Exponent for finer control (curve)
|
) # Exponent for finer control (curve)
|
||||||
|
|
||||||
# This kinda looks dumb being seperate from the following block, but this
|
# This kinda looks dumb being seperate from the following block, but this
|
||||||
# maintains the separation between modifying the control message and sending it
|
# maintains the separation between modifying the control message and sending it.
|
||||||
if self.use_cmd_vel:
|
if self.use_cmd_vel:
|
||||||
twist.linear.x *= 1.5
|
# These scaling factors convert raw stick inputs to absolute m/s and rad/s
|
||||||
twist.angular.z *= 0.5
|
# values that DiffDriveController will convert to motor RPM, rather than
|
||||||
|
# the plain Twist, which just sends the stick values as duty cycle and
|
||||||
|
# sends that scaled to the motors.
|
||||||
|
twist.linear.x *= 1.0
|
||||||
|
twist.angular.z *= 1.5
|
||||||
|
|
||||||
# Publish
|
# Publish
|
||||||
if self.use_cmd_vel:
|
if self.use_cmd_vel:
|
||||||
|
|||||||
Reference in New Issue
Block a user