Hello!
I have added a custom gripper to my za6. I have created a xacro file for it and adjusted the za6_macro.xacro file to add the gripper to the robot when my tool is specified. I have also adjusted all the yaml files, srdf files, and launch files necessary to get my gripper showing in rviz when I launch the robot. I ran the moveit setup assistant and edited all those files to make new planning groups so I can also plan and execute move_group goals relative to links on my gripper rather than only links on the base robot. I can also control my gripper, but I am not currently using ros_control to do so.
The system is now telling me that it does not know the states of all joints (referring to the two joints in my gripper), so the next step is obviously to get the current state of my gripper joints into the ros system.
Here is my current understanding:
- hal_ros_control (which the za6 uses) extends the ideas of ros_control in that there is a hardware_interface::RobotHW instance running which controllers can use to interface with and command the robot and get the state of the robot.
- hal_ros_control creates the required node with configuration files using the machinekit-hal system.
- hal_hw_interface is the realtime node created by the configuration files that is running and producing the joint states and accepting commands to control the arm.
- ros_control has (or maybe had, see below) a limitation that there can only be one and only one hardware_interface::RobotHW instance running, so I can’t just make a second node to interface to only my gripper.
Based on that, I can see 3 possibilities right now (though someone may have a better idea):
- there’s some way to get my (485 modbus controlled) gripper actuators controlled/read through the machinekit-hal system. I haven’t found any examples of how to do this.
- there’s a possibility that I can somehow use combined_robot_hw to combine my interface with the za6 hal interface into one single node as plugins. (Ref1, Ref2) Concerns: I don’t need realtime for my node but I don’t see how the realtime could be a plugin with something that isn’t realtime. I also don’t know how this would work since hal_ros_control doesn’t seem to launch in a standard way. As I understand it, hal_mgr uses sytem calls to straight rosrun things and calls system calls somehow to run hal_hw_interface
- I could use a joint state publisher and aggregate the JointState messages from my gripper and the rest of the arm to produce one single JointState message comprised of all joints in the system. Concerns: This seems to be discouraged or at least non-typical. Also, since the hal_hw_interface node is not launched in a standard way, I don’t know how to remap the topics to make this work. Also, going through another node, I wonder if the timing of messages might lead to issues.
I know that tormach has used grippers attached to the arm, but it looks like those are controlled via ethercat. Is there any guidance on which way I should choose? I very much appreciate any help or recommendations or corrections.
Thank you!