CommonplaceRobotics / iRC_ROS

ROS2 packages for the igus Robot Control
Apache License 2.0
15 stars 7 forks source link

CRI: Can't interact with robot, Unknown message type: "CMDERROR" #110

Open rs1659 opened 7 months ago

rs1659 commented 7 months ago

Description

Preface: Not entirely sure if this actually is a bug, but CRI can be selected and the bringup mentions no other interactions so I assume it should at least work to some extent. Also no "joint_velocity_controller" is started to interact with.

When using the hardware interface CRI, sending any message like described in the bringup section (see: https://github.com/CommonplaceRobotics/iRC_ROS/tree/humble/irc_ros_bringup#rebel-6dof) causes a constant stream of error messages without any robot movement at all. While I am aware that the CRI side of things is quite limited, I am too new to robotics and ROS to dig deep myself. I am supposed to use the igus ReBel 6DOF ideally with MoveIt2, however I do not currently have the possibilities to access the CAN interface. Do I have to have the latter to get the robot working with MoveIt2 which - to my understanding at least - has to be able to execute JointTrajectories?

Your environment

ROS Distro: Humble
OS Version: Ubuntu 22.04
Branch: humble
Protocol: CRI

To Reproduce

  1. Change hardware protocol to CRI in the rebel launch file
  2. Launch irc_ros_bringup package with the rebel.launch.py file
  3. Publish JointTrajectory message as described in the bringup section

Expected behavior

Best case: Robot moves accordingly, as CRI interface exists and no other robot interaction except publishing JointTrajectories is described Worst case: More meaningful error message

Actual behavior

Unbenannt
Robeatrice commented 7 months ago

Hello, I do have the same problem with the dof robot.

Did you find a solution for this problemm, that you might share with me? Thank you !

rs1659 commented 7 months ago

Hello @Robeatrice,

I have not managed to do anything about the error as described above, however I am currently working on developing some sort of workaround.

What I believe to have found so far that might help you:

  1. joint_trajectory_controller and position_controller don't seem to be "supported" at all by the CRI interface
  2. the velocity_controller appears to work fine

What I did to get the robot moving and handle simpler stuff like pick and place was the following (for the positions where the following lines are to be placed please look at the current joint_trajectory_controller as it's analogous):

  1. Add a velocity_controller in the irc_ros_bringup/config/controller_igus_rebel_6dof.yaml file (if you are using the 6dof version; do it in the corresponding .yaml if not): grafik
  2. Set the joints to be handled by the velocity_controller in the same file: grafik
  3. Add the controller to the dependencies in the package.xml: grafik
  4. Add and start the controller in the rebel.launch.py file: grafik grafik

After these steps you should have a velocity_controller running when launching the launch file. With this you can actually send joint velocities to the robot via CRI. A general description of what to do roughly can be found in the README of the ROS1 driver: https://bitbucket.org/truphysics/igus_rebel/src/master/

Now comes the harder part where you implement your own nodes to somehow get your intentions mapped to simple joint velocities. As this is part of my current masters thesis I cannot provide you with the code itself, but to e.g. get the robot to drive to certain joint angles, you can send corresponding joint velocities and send velocities of 0 when the joints reach their respective target.

TL;DR: To be certain, an answer from the author(s) would be required to clarify but it appears to me that joint_trajectory_controller doesn't work with CRI (therefore also no MoveIt out of the box) but velocity_controller does. With the necessary input data (current joint angles via joint_states topic, joint vector for correct order via JointTrajectoryControllerState topic, ...) you could implement the required logic to achieve your desired behaviour.

Robeatrice commented 7 months ago

Hello @rs1659, thank you so much for your answer! This really did work and the robot is at least moving. I do think, that you are right and that joint_trajectory_controller doesn't work with cri.

Good luck with your masters thesis! If it gets published when your done I would really love reading it.