compas-rrc / compas_rrc

Online control for ABB robots over a simple-to-use Python interface.
https://compas-rrc.github.io/compas_rrc/
MIT License
22 stars 6 forks source link

rrc.MoveToJoints uses JointTrajectoryPoint #11

Open yck011522 opened 3 years ago

yck011522 commented 3 years ago

Summary

As a user, I want to send compas_fab planned result directly via rrc so that I do not need to manually convert JointTrajectoryPoint to compas_rrc.RobotJoints/ExternalAxes.

Details

It might be similar to # 10 but it is slightly different. As a user of the RFL URDF, I get planner result sometimes in full configuration (4 robots + 10 external axis). It would be nice if the functions in rrc that consumes a compas.robots.Configuration can automatically take the relevant joint values. Because in practice I have different controllers managing 4 robots and they all consume part of this config.

full_config # type: compas.robots.JointTrajectoryPoint
robot_11.send(rrc.MoveToJoints.from_configuration(full_config))
robot_12.send(rrc.MoveToJoints.from_configuration(full_config))
robot_21.send(rrc.MoveToJoints.from_configuration(full_config))
robot_22.send(rrc.MoveToJoints.from_configuration(full_config))
yck011522 commented 3 years ago

I believe JointTrajectoryPoint has velocity information

gonzalocasas commented 3 years ago

Linked to #10

Good point.

Reducing the list of individual joint velocities in a JointTrajectory to a single tcp speed is something that the industrial robot client of ROS already does, and we could also bring in. I was never completely convinced with the resulting speeds thou but that might have been side effect of other parts of the system back then.

Since this reduction needs knowledge of the limits of the joints (hence of the whole robot model), it would need to be on compas_fab side, rather than here, but perhaps that is exactly the interplay between this issue and #10, eg:

ros = RosClient()
rfl = ros.load_robot()
robot_11 = AbbClient(robot.client, '/rob11')

# do some planning here and get a JointTrajectory object

full_config = joint_traj.points[0]

group_config = rfl.get_group_configuration('robot11_eaXYZ', full_config)     # this function already exist
robot_11.send(rrc.MoveToJoints.from_configuration(group_config))

``