I am using Ros noetic and trying to send moveit rviz goal to the robot to execute. I am able to secure the connection between the PC and robot.
To test I echoed joint_states and was able
rtopic pub /ur_hardware_interface/script_command std_msgs/String "data: 'popup(\"Hello from ROS\")'" --once
Checked the controllers
controller:
-
name: "joint_state_controller"
state: "running"
type: "joint_state_controller/JointStateController"
claimed_resources:
-
hardware_interface: "hardware_interface::JointStateInterface"
resources: []
-
name: "pos_joint_traj_controller"
state: "initialized"
type: "position_controllers/JointTrajectoryController"
claimed_resources:
-
hardware_interface: "hardware_interface::PositionJointInterface"
resources:
- elbow_joint
- shoulder_lift_joint
- shoulder_pan_joint
- wrist_1_joint
- wrist_2_joint
- wrist_3_joint
-
name: "scaled_pos_joint_traj_controller"
state: "running"
type: "position_controllers/ScaledJointTrajectoryController"
claimed_resources:
-
hardware_interface: "scaled_controllers::ScaledPositionJointInterface"
resources:
- elbow_joint
- shoulder_lift_joint
- shoulder_pan_joint
- wrist_1_joint
- wrist_2_joint
- wrist_3_joint
-
name: "joint_group_vel_controller"
state: "initialized"
type: "velocity_controllers/JointGroupVelocityController"
claimed_resources:
-
hardware_interface: "hardware_interface::VelocityJointInterface"
resources:
- elbow_joint
- shoulder_lift_joint
- shoulder_pan_joint
- wrist_1_joint
- wrist_2_joint
- wrist_3_joint
-
name: "speed_scaling_state_controller"
state: "running"
type: "scaled_controllers/SpeedScalingStateController"
claimed_resources:
-
hardware_interface: "scaled_controllers::SpeedScalingInterface"
resources: []
-
name: "force_torque_sensor_controller"
state: "running"
type: "force_torque_sensor_controller/ForceTorqueSensorController"
claimed_resources:
-
hardware_interface: "hardware_interface::ForceTorqueSensorInterface"
resources: []
but on polyscope always stuck at please wait
I am not able to send action commands to the robot and is not able to respond
#!/usr/bin/env python
import rospy
import actionlib
from control_msgs.msg import FollowJointTrajectoryAction, FollowJointTrajectoryGoal
from trajectory_msgs.msg import JointTrajectoryPoint
def move_ur5():
rospy.init_node('test_move_scaled_pos_joint_traj_controller')
# Action client for your specific controller action namespace
client = actionlib.SimpleActionClient('/scaled_pos_joint_traj_controller/follow_joint_trajectory', FollowJointTrajectoryAction)
rospy.loginfo("Waiting for action server...")
client.wait_for_server()
rospy.loginfo("Action server found.")
goal = FollowJointTrajectoryGoal()
goal.trajectory.joint_names = [
'elbow_joint',
'shoulder_lift_joint',
'shoulder_pan_joint',
'wrist_1_joint',
'wrist_2_joint',
'wrist_3_joint'
]
# Provide a simple target pose, adjust joint order & positions accordingly
point = JointTrajectoryPoint()
point.positions = [0.0, -1.57, 1.57, 0.0, 0.0, 0.0] # radians
point.velocities = [0.0] * 6
point.time_from_start = rospy.Duration(3.0)
goal.trajectory.points.append(point)
client.send_goal(goal)
rospy.loginfo("Goal sent, waiting for result...")
client.wait_for_result()
rospy.loginfo("Movement completed.")
if __name__ == '__main__':
try:
move_ur5()
except rospy.ROSInterruptException:
pass
no output
rostopic echo /scaled_pos_joint_traj_controller/state
