[Q] About creating a ROS publisher

Typically: "How do I... ", "How can I... " questions
Post Reply
stms5001
Posts: 1
Joined: 16 Apr 2015, 15:48

[Q] About creating a ROS publisher

Post by stms5001 »

Hi guys I need some help in writing a code in C++ to create a publisher for ROS
I'm failing to understand what's the problem in here
I'm creating a program similar to the rosBubbleRob as a method to interact with ROS

Code: Select all

  ros::ServiceClient client_enablePublisher=node.serviceClient<vrep_common::simRosEnablePublisher>("/vrep/simRosEnablePublisher");
    vrep_common::simRosEnablePublisher pubtest;
    pubtest.request.topicName="leftMotor";
    pubtest.request.queueSize=1000;
    pubtest.request.streamCmd=simros_strmcmd_get_joint_state;
    pubtest.request.auxInt1=leftMotorHandle;


everytime I run the run the application it just doesn't give me the effectivetopicname when I tried to cout the response
is there something that is missing in my code ?
do I need to fill the request for the auxInt2 and the auxString ?

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: [Q] About creating a ROS publisher

Post by coppelia »

Hello,

what is the returned effectiveTopicName?
Are you sure the leftMotorHandle is correct?

Best would be to slowly modify the rosBubbleRob example, until the point where you get a problem. Then it will be easier to see what is wrong.

Cheers

Post Reply