0
$\begingroup$

Rosanswers logo

I would like to know if there is some method or trait class in (roscpp or another library) which allows getting the "associated stamped type" of a Type T. For instance

StampedType::type ::type

If it does not exist, IMO it should. Its a very interesting method to do generic programming in ROS.

BTW I've also missed message inheritance in ROS (but this is another issue where a lot of discussion it is possible)


Originally posted by Pablo Iñigo Blasco on ROS Answers with karma: 2982 on 2012-12-29

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I don't know of any implementation of that method. It might make an interesting library to contribute. However there's no way to do it automatically as a stamped type is more of a convention, and not all messages have it.

In the tf datatypes you will find a Stamped<> templated datatype for each type of data supported.


Originally posted by tfoote with karma: 58457 on 2012-12-29

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Pablo Iñigo Blasco on 2012-12-31:
Yep I understand. It's a pitty that Stamped<> is only for tf messages and the only allowed types are statically set. Moreover it forces you to use a tfBroadacaster instead a generic ros msg publisher.

Comment by Pablo Iñigo Blasco on 2012-12-31:
In any case it would be possible if there would be a template mechanism to generate msgs stamped datatypes. In that case Stamped would be a rosmsg type. In such case all the StampedMsgTypes would be unnecessary. The method ros::Publisher::publish might accept T or Stamped

Comment by Pablo Iñigo Blasco on 2012-12-31:
The header data could be filled explicitly or implicitly by the ros::Publisher. At the same time, a subscriber could use either T or Stamped . IMHO this could be possible maintaining the backwards compatibility.

Comment by Pablo Iñigo Blasco on 2012-12-31:
The header data could be filled explicitly or implicitly by the ros::Publisher... I think that this could be possible maintaining the backwards compatibility. Using rosmsg infraestructure even would be possible to make compatible StampedPose with Stamped

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.