-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: Not able to control robot via publihing on command/joint_group #235
Comments
Please enable debug logging on the xs_sdk of the follower and provide the results. |
Only this is output and nothing else.
Commands are definitely being published Here are my configs port: /dev/ttyDXL
groups:
arm:
operating_mode: position
profile_type: time
profile_velocity: 2000
profile_acceleration: 1000
torque_enable: true
singles:
gripper:
operating_mode: position
torque_enable: true port: /dev/ttyDXL
joint_order: [waist, shoulder, elbow, forearm_roll, wrist_angle, wrist_rotate, gripper]
sleep_positions: [0, -1.80, 1.55, 0, 0.8, 0, 0]
joint_state_publisher:
update_rate: 100
publish_states: true
topic_name: joint_states
groups:
arm: [waist, shoulder, elbow, forearm_roll, wrist_angle, wrist_rotate]
grippers:
gripper:
horn_radius: 0.014
arm_length: 0.024
left_finger: left_finger
right_finger: right_finger
shadows:
shoulder:
shadow_list: [shoulder_shadow]
calibrate: true
elbow:
shadow_list: [elbow_shadow]
calibrate: true
sisters:
motors:
waist:
ID: 1
Baud_Rate: 3
Return_Delay_Time: 0
Drive_Mode: 0
Velocity_Limit: 131
Min_Position_Limit: 0
Max_Position_Limit: 4095
Secondary_ID: 255
shoulder:
ID: 2
Baud_Rate: 3
Return_Delay_Time: 0
Drive_Mode: 0
Velocity_Limit: 131
Min_Position_Limit: 819
Max_Position_Limit: 3345
Secondary_ID: 255
shoulder_shadow:
ID: 3
Baud_Rate: 3
Return_Delay_Time: 0
Drive_Mode: 1
Velocity_Limit: 131
Min_Position_Limit: 819
Max_Position_Limit: 3345
Secondary_ID: 2
elbow:
ID: 4
Baud_Rate: 3
Return_Delay_Time: 0
Drive_Mode: 0
Velocity_Limit: 131
Min_Position_Limit: 648
Max_Position_Limit: 3094
Secondary_ID: 255
elbow_shadow:
ID: 5
Baud_Rate: 3
Return_Delay_Time: 0
Drive_Mode: 1
Velocity_Limit: 131
Min_Position_Limit: 648
Max_Position_Limit: 3094
Secondary_ID: 4
forearm_roll:
ID: 6
Baud_Rate: 3
Return_Delay_Time: 0
Drive_Mode: 0
Velocity_Limit: 131
Min_Position_Limit: 0
Max_Position_Limit: 4095
Secondary_ID: 255
wrist_angle:
ID: 7
Baud_Rate: 3
Return_Delay_Time: 0
Drive_Mode: 1
Velocity_Limit: 131
Min_Position_Limit: 910
Max_Position_Limit: 3447
Secondary_ID: 255
wrist_rotate:
ID: 8
Baud_Rate: 3
Return_Delay_Time: 0
Drive_Mode: 0
Velocity_Limit: 131
Min_Position_Limit: 0
Max_Position_Limit: 4095
Secondary_ID: 255
gripper:
ID: 9
Baud_Rate: 3
Return_Delay_Time: 0
Drive_Mode: 0
Velocity_Limit: 131 Echoing the /follower/commands/joint group shows that the right commands I want are definitely being published #!/usr/bin/env python3
import rclpy
from rclpy.node import Node
from sensor_msgs.msg import JointState
from interbotix_xs_msgs.msg import JointGroupCommand
from manipulation.utils import WidowXSubscriber, WidowXPublisher
import numpy as np
from math import pi
class FollowerNode(Node):
def __init__(self):
super().__init__('follower_node')
self.get_logger().debug('Initialized follower node')
# Create subscribers for both leader and follower
self.leader_sub = WidowXSubscriber(self, '/leader/joint_states', False)
self.get_logger().debug('Created leader subscriber')
self.follower_sub = WidowXSubscriber(self, '/follower/joint_states', False)
self.get_logger().debug('Created follower subscriber')
# Create publishers using WidowXPublisher classd
self.arm_pub = WidowXPublisher(self, '/follower/commands/joint_group', False)
self.get_logger().debug('Created arm publisher')
self.gripper_pub = WidowXPublisher(self, '/follower/commands/joint_single', False)
self.get_logger().debug('Created gripper publisher')
# Create timer for control loop (10Hz)
self.timer = self.create_timer(0.2, self.control_loop)
self.get_logger().debug('Created control loop timer')
def control_loop(self):
# Get current joint positions
leader_joints = self.leader_sub.get_joint_positions()
follower_joints = self.follower_sub.get_joint_positions()
# Check if either subscriber returned None
if leader_joints is None or follower_joints is None:
self.get_logger().warn('Joint positions not available yet')
return
# Directly command the follower to match leader positions
# Handle arm joints (all except last)
self.arm_pub.publish_commands("arm", leader_joints[:-1])
# Handle gripper (last joint)
self.gripper_pub.publish_commands("gripper", np.array([leader_joints[-1]]))
def main(args=None):
rclpy.init(args=args)
node = FollowerNode()
rclpy.spin(node)
rclpy.shutdown()
if __name__ == '__main__':
print("STARTING FOLLOWER NODE")
main() |
Please provide the RMW implementation you're using by running |
Hi Lukeschmitt, |
Question
How do i precisely control joint positions via a publisher in ros2 humble
Robot Model
wx250s
Operating System
Ubuntu 22.04
ROS Version
ROS 2 Humble
Additional Info
vignesh@vignesh-OMEN:~$ ros2 topic list
/follower/commands/joint_group
/follower/commands/joint_single
/follower/commands/joint_trajectory
/follower/joint_states
I see these topics and I am trying to command joint positions at 30 Hz via a publisher that looks like this
Either I get the very first pose being acted on and then everything else ignored or , nothing at all.
The text was updated successfully, but these errors were encountered: