As in this tutorial, I create the JointHandle in my_hardware_interface.cpp. However, I don't receive the DiffDriveController's output when I register to the JointHandle. I assume that this is due to the fact, that the JointHandle is called in my_namespace while my_velocity_controller is assigned to no namespace.
Therefore my question: Is there any possibility to create a JointHandle if it is not in the same namespace as it's controller? Here's an minimal working example of the my_hardware_interface.cpp.
namespace my_namespace {
bool MyHWInterface::init(ros::NodeHandle & root_nh, ros::NodeHandle & robot_hw_nh) {
[...]
for (unsigned int i = 0; i < num_joints_; i++) {
// Create JointStateHandle
hardware_interface::JointStateHandle joint_state_handle(joint_names_[i], & joint_positions_[i], & joint_velocities_[i], & joint_efforts_[i]);
// Register with JointStateInterface.
joint_state_interface_.registerHandle(joint_state_handle);
// Can I create a JointHandle if the DiffDriveController is NOT in my_namespace???
hardware_interface::JointHandle joint_handle(joint_state_handle, & joint_velocity_commands_[i]);
velocity_joint_interface_.registerHandle(joint_handle);
}
}
}
For several reasons, it is necessary that my
control.yaml
has no namespace and thus looks like:As in this tutorial, I create the
JointHandle
inmy_hardware_interface.cpp
. However, I don't receive theDiffDriveController
's output when I register to theJointHandle
. I assume that this is due to the fact, that theJointHandle
is called inmy_namespace
whilemy_velocity_controller
is assigned to no namespace.Therefore my question: Is there any possibility to create a JointHandle if it is not in the same namespace as it's controller? Here's an minimal working example of the
my_hardware_interface.cpp
.