How to propagate actuator commands from actuator to joint space
I'm working in on the kinetic-devel branch, and need to have the transmissions propagate actuator commands from actuator to joint space, but am having trouble figuring out how to make this happen because no ActuatorToJoint interfaces are created when the transmissions are created. I know this is not typically something you need to do, but humor me.
I'm trying to do all of this without copy/pasting/modifying all of the work done by the transmission_interface_loader. I feel like there's gotta be a "built in" way to make this happen, but i'm struggling to see it.
So picture a SimRobotHw in a gazebo plugin that will read joint state information from the sim robot, convert to actuator space, then give that to another HardwareRobotHw implementation that converts that actuator state info to joint state info in the read()
method. Then in the write()
method, it'll convert any joint commands to actuator commands and send it back over to the SimRobotHw. So now the SimRobotHw has a bunch of actuator commands it needs to convert back into joint space so it can send those commands to the simulated robots joints.
Edit: This kinda looks like,
class SimRobotHw : public RobotHw
{
read()
{
sim_jnts_to_ros_control_jnts();
propegate_jnt_state_to_act_state();
publish(); // publish actuator data to be received by HardwareRobotHw in its read() method
}
write()
{
subscribe(); // Receive actuator commands from HardwareRobotHw in its write() method
propegate_joint_cmd_to_act_cmd();
ros_cntrl_joints_to_sim_jnts();
}
}
Then the other side looks like a typical implementation of a RobotHw
as you would expect and doesn't do any reverse propegation.