Dear Orocos users,
In order to make a component as general as possible I decided to make a
property which would give the possibility to choose the port type e.g.
choose between KDL::Twist, std::vector, geometry_msgs:Twist.
- So my first question is, what is the best way of doing this? Would you
even recommend it?
- The second question is about how I implemented it:
*typedef RTT::InputPort< KDL::Twist > PortType_IN_KDL;**
**typedef RTT::InputPort< geometry_msgs::Twist > PortType_IN_GEO;**
**typedef RTT::InputPort< std::vector<double> > PortType_IN_VEC;*
*boost::shared_ptr< PortType_IN_VEC > vel_vec_inport_;**
**boost::shared_ptr< PortType_IN_GEO > vel_geo_inport_;**
**boost::shared_ptr< PortType_IN_KDL > vel_kdl_inport_;*
and then in configureHook in cpp did this for each:
vel_vec_inport_ = boost::make_shared< CartPortType_IN_VEC>();
this->addPort("vel_vec_inport",*vel_vec_inport_).doc("velocity inport in
The problem is that once I start the component, stopping it will cause
problem. Either for orocos or for the component itself...
Inside deployer if I call component.stop and then component.cleanup it
doesn't complain. But if I now call 'configure', it goes to the famous
error "pure virtual method called, terminate called without an active
exception"... I also tried to reset the shared pointer with
But that doesn't seem to help. I tried calling
this->removePort(vel_vec_inport_) in cleanup, but that doesn't even
If once the component has started, I exit deployer I get the error:
*terminate called after throwing an instance of
** what(): boost: mutex lock failed in pthread_mutex_lock: Invalid
**/opt/ros/indigo/lib/rtt_ros/deployer: line 5: 24934
Aborted (core dumped) deployer "$@"*
I would appreciate if you have any idea why things go wrong here...