You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I want to use a joystick to teleoperate the robot (real-time operation).
I wrote my own node (with the help of ChatGPT) that subscribes to the /joy topic and moves the pose in x and y when something is published to joy:
joystick_teleop.py
#!/usr/bin/env pythonimportrospyfromsensor_msgs.msgimportJoyfrommoveit_commanderimportRobotCommander, MoveGroupCommanderfromgeometry_msgs.msgimportPoseclassJoystickTeleop:
def__init__(self):
rospy.init_node('joystick_teleop')
rospy.logwarn("started teleop node")
# Subscribe to the joystick topicrospy.Subscriber("joy", Joy, self.joy_callback)
# Create a RobotCommander for the robotself.robot=RobotCommander()
# Create a MoveGroupCommander for the desired planning groupself.move_group=MoveGroupCommander("arm") # Replace with your move group name# Initialize the target poseself.target_pose=Pose()
defjoy_callback(self, data):
rospy.loginfo("callback executed")
# Map joystick input to robot motion commands# Example: Control the end effector position of a robot armifdata.axes[0] !=0ordata.axes[1] !=0:
print(data)
# Update the target pose based on the joystick inputself.target_pose.position.x+=data.axes[0] *0.1self.target_pose.position.y+=data.axes[1] *0.1# Set the target pose for the move groupself.move_group.set_pose_target(self.target_pose)
self.move_group.set_planning_time(5) # Increase the planning time to 5 seconds# Plan and execute the motionself.move_group.go(wait=True)
if__name__=='__main__':
try:
joystick_teleop=JoystickTeleop()
rospy.spin()
exceptrospy.ROSInterruptException:
pass
For some reason the robot does not react to the node. I'm getting the following errors:
[ERROR] [1686832400.868134914] [/move_group]: arm/arm: Unable to sample any valid states for goal tree
[ INFO] [1686832400.868209984] [/move_group]: arm/arm: Created 1 states (1 start + 0 goal)
[ INFO] [1686832400.868454296] [/move_group]: No solution found after 5.003464 seconds
[ WARN] [1686832400.868512755] [/move_group]: Timed out
[ INFO] [1686832400.884523583] [/move_group]: Unable to solve the planning problem
[ INFO] [1686832402.538878936] [/move_group]: Combined planning and execution request received for MoveGroup action. Forwarding to planning and execution pipeline.
[ INFO] [1686832402.538982584] [/move_group]: Planning attempt 1 of at most 1
This is from the info from the joystick_teleop.py: [ INFO] [1686832400.885087394] [/moveit_python_wrappers_1686832320279744835]: ABORTED: TIMED_OUT
The text was updated successfully, but these errors were encountered:
Hi,
I want to use a joystick to teleoperate the robot (real-time operation).
I wrote my own node (with the help of ChatGPT) that subscribes to the
/joy
topic and moves the pose in x and y when something is published to joy:joystick_teleop.py
For some reason the robot does not react to the node. I'm getting the following errors:
This is from the info from the joystick_teleop.py:
[ INFO] [1686832400.885087394] [/moveit_python_wrappers_1686832320279744835]: ABORTED: TIMED_OUT
The text was updated successfully, but these errors were encountered: