ros-controls / ros_control

Generic and simple controls framework for ROS
http://wiki.ros.org/ros_control
BSD 3-Clause "New" or "Revised" License
487 stars 307 forks source link

TransmissionInterfaceLoader running with "this" pointer to get StateInterface cause SPAWNER ERROR #481

Closed zvyun closed 3 years ago

zvyun commented 3 years ago

I found that when I use "this" pointer to get interface like the example said will cause problem.

usage: spawner [-h] [--stopped] [--wait-for topic] [--namespace ns] [--timeout T] [--no-timeout] [--shutdown-timeout SHUTDOWN_TIMEOUT] controller [controller ...] spawner: error: the following arguments are required: controller But use "transmission_interface::RobotTransmissions robottransmissions" works fine.

My code is something like that.

void HardwareInterface::read(const ros::Time& time, const ros::Duration& period) { this->get<transmission_interface::ActuatorToJointStateInterface>()->propagate(); // Cause Problem robot_transmissions_.get<transmission_interface::ActuatorToJointStateInterface>()->propagate(); // Works Fine } Is any other things should I do to use "this" pointer?

zvyun commented 3 years ago

It seems that "TransmissionInterfaceLoader" doesn't register "ActuatorToJointStateInterface" directly to "RobotHW" class. I got some kind of misunderstand of the example code.