Robotics StackExchange | Archived questions

is it possible to change name ros::Publisher to xyz::Publishernew in talker.cpp node?

I want to change the name ros::Publisher to xyz::Publishernew. Is it possible?

Thank you for your answer in advance.

Asked by SumitP on 2017-11-02 05:40:59 UTC

Comments

On first thought this seems like a strange thing to do. Could you perhaps tell us why you're looking to do that?

Asked by gvdhoorn on 2017-11-03 11:45:49 UTC

Answers

I don't See any reason for doing this, but yes you can so this:

namespace xyz
{
      typedef ros:: Publisher Publishernew;
}

ros::Publisher one_ros_publisher_object;

xyz::Publishernew yet_another_ros_publisher_object;

Asked by Wolf on 2017-11-08 16:33:03 UTC

Comments

Ahh That's Great. thank you.

Asked by SumitP on 2017-11-09 03:42:20 UTC