mirror of
https://github.com/SHC-ASTRA/rover-ros2.git
synced 2026-04-20 11:51:16 -05:00
refactor: remedy QoS profiles
This commit is contained in:
@@ -14,16 +14,16 @@ from control_msgs.msg import JointJog
|
|||||||
from astra_msgs.msg import SocketFeedback, DigitFeedback, ArmManual
|
from astra_msgs.msg import SocketFeedback, DigitFeedback, ArmManual
|
||||||
from astra_msgs.msg import ArmFeedback, VicCAN, RevMotorState
|
from astra_msgs.msg import ArmFeedback, VicCAN, RevMotorState
|
||||||
|
|
||||||
# control_qos = qos.QoSProfile(
|
control_qos = qos.QoSProfile(
|
||||||
# history=qos.QoSHistoryPolicy.KEEP_LAST,
|
history=qos.QoSHistoryPolicy.KEEP_LAST,
|
||||||
# depth=1,
|
depth=2,
|
||||||
# reliability=qos.QoSReliabilityPolicy.BEST_EFFORT,
|
reliability=qos.QoSReliabilityPolicy.BEST_EFFORT, # Best Effort subscribers are still compatible with Reliable publishers
|
||||||
# durability=qos.QoSDurabilityPolicy.VOLATILE,
|
durability=qos.QoSDurabilityPolicy.VOLATILE,
|
||||||
# deadline=1000,
|
# deadline=Duration(seconds=1),
|
||||||
# lifespan=500,
|
# lifespan=Duration(nanoseconds=500_000_000), # 500ms
|
||||||
# liveliness=qos.QoSLivelinessPolicy.SYSTEM_DEFAULT,
|
# liveliness=qos.QoSLivelinessPolicy.SYSTEM_DEFAULT,
|
||||||
# liveliness_lease_duration=5000
|
# liveliness_lease_duration=Duration(seconds=5),
|
||||||
# )
|
)
|
||||||
|
|
||||||
thread = None
|
thread = None
|
||||||
|
|
||||||
@@ -112,11 +112,11 @@ class ArmNode(Node):
|
|||||||
|
|
||||||
# Manual: /arm/manual_new is published by Servo or Basestation
|
# Manual: /arm/manual_new is published by Servo or Basestation
|
||||||
self.jointjog_pub_ = self.create_subscription(
|
self.jointjog_pub_ = self.create_subscription(
|
||||||
JointJog, "/arm/manual_new", self.jointjog_callback, 1
|
JointJog, "/arm/manual_new", self.jointjog_callback, qos_profile=control_qos
|
||||||
)
|
)
|
||||||
# IK: /joint_commands is published by JointTrajectoryController via topic_based_control
|
# IK: /joint_commands is published by JointTrajectoryController via topic_based_control
|
||||||
self.joint_command_sub_ = self.create_subscription(
|
self.joint_command_sub_ = self.create_subscription(
|
||||||
JointState, "/joint_commands", self.joint_command_callback, 1
|
JointState, "/joint_commands", self.joint_command_callback, qos_profile=control_qos
|
||||||
)
|
)
|
||||||
|
|
||||||
# Feedback
|
# Feedback
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ CORE_WHEEL_RADIUS = 0.171 # meters
|
|||||||
CORE_GEAR_RATIO = 100.0 # Clucky: 100:1, Testbed: 64:1
|
CORE_GEAR_RATIO = 100.0 # Clucky: 100:1, Testbed: 64:1
|
||||||
|
|
||||||
control_qos = qos.QoSProfile(
|
control_qos = qos.QoSProfile(
|
||||||
# history=qos.QoSHistoryPolicy.KEEP_LAST,
|
history=qos.QoSHistoryPolicy.KEEP_LAST,
|
||||||
depth=2,
|
depth=2,
|
||||||
# reliability=qos.QoSReliabilityPolicy.BEST_EFFORT,
|
reliability=qos.QoSReliabilityPolicy.BEST_EFFORT, # Best Effort subscribers are still compatible with Reliable publishers
|
||||||
# durability=qos.QoSDurabilityPolicy.VOLATILE,
|
durability=qos.QoSDurabilityPolicy.VOLATILE,
|
||||||
# deadline=Duration(seconds=1),
|
# deadline=Duration(seconds=1),
|
||||||
# lifespan=Duration(nanoseconds=500_000_000), # 500ms
|
# lifespan=Duration(nanoseconds=500_000_000), # 500ms
|
||||||
# liveliness=qos.QoSLivelinessPolicy.SYSTEM_DEFAULT,
|
# liveliness=qos.QoSLivelinessPolicy.SYSTEM_DEFAULT,
|
||||||
|
|||||||
@@ -37,23 +37,16 @@ ARM_STOP_MSG = ArmManual() # "
|
|||||||
BIO_STOP_MSG = BioControl() # "
|
BIO_STOP_MSG = BioControl() # "
|
||||||
|
|
||||||
control_qos = qos.QoSProfile(
|
control_qos = qos.QoSProfile(
|
||||||
# history=qos.QoSHistoryPolicy.KEEP_LAST,
|
history=qos.QoSHistoryPolicy.KEEP_LAST,
|
||||||
depth=2,
|
depth=2,
|
||||||
# reliability=qos.QoSReliabilityPolicy.BEST_EFFORT,
|
reliability=qos.QoSReliabilityPolicy.BEST_EFFORT,
|
||||||
# durability=qos.QoSDurabilityPolicy.VOLATILE,
|
durability=qos.QoSDurabilityPolicy.VOLATILE,
|
||||||
# deadline=Duration(seconds=1),
|
# deadline=Duration(seconds=1),
|
||||||
# lifespan=Duration(nanoseconds=500_000_000), # 500ms
|
# lifespan=Duration(nanoseconds=500_000_000), # 500ms
|
||||||
# liveliness=qos.QoSLivelinessPolicy.SYSTEM_DEFAULT,
|
# liveliness=qos.QoSLivelinessPolicy.SYSTEM_DEFAULT,
|
||||||
# liveliness_lease_duration=Duration(seconds=5),
|
# liveliness_lease_duration=Duration(seconds=5),
|
||||||
)
|
)
|
||||||
|
|
||||||
arm_ik_qos = qos.QoSProfile(
|
|
||||||
history=qos.QoSHistoryPolicy.KEEP_LAST,
|
|
||||||
depth=1,
|
|
||||||
reliability=qos.QoSReliabilityPolicy.BEST_EFFORT,
|
|
||||||
durability=qos.QoSDurabilityPolicy.VOLATILE,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
STICK_DEADZONE = float(os.getenv("STICK_DEADZONE", "0.05"))
|
STICK_DEADZONE = float(os.getenv("STICK_DEADZONE", "0.05"))
|
||||||
|
|
||||||
@@ -187,10 +180,10 @@ class Headless(Node):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.arm_ik_twist_publisher = self.create_publisher(
|
self.arm_ik_twist_publisher = self.create_publisher(
|
||||||
TwistStamped, "/servo_node/delta_twist_cmds", arm_ik_qos
|
TwistStamped, "/servo_node/delta_twist_cmds", qos_profile=control_qos
|
||||||
)
|
)
|
||||||
self.arm_ik_jointjog_publisher = self.create_publisher(
|
self.arm_ik_jointjog_publisher = self.create_publisher(
|
||||||
JointJog, "/servo_node/delta_joint_cmds", arm_ik_qos
|
JointJog, "/servo_node/delta_joint_cmds", qos_profile=control_qos
|
||||||
)
|
)
|
||||||
|
|
||||||
##################################################
|
##################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user