ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

ROSfc's profile - activity

2020-07-29 22:44:22 -0500 received badge  Famous Question (source)
2020-07-29 22:44:22 -0500 received badge  Notable Question (source)
2020-07-29 22:44:22 -0500 received badge  Popular Question (source)
2019-04-26 00:48:44 -0500 marked best answer roscpp relative vs global parameter (tutorial)

Hello,

I thought I understood the concept of global and relative. But apparently while doing the tutorial

ros::NodeHandle nh;
std::string global_name, relative_name, default_param;
if (nh.getParam("/global_name", global_name))
{
  ...
}

 if (nh.getParam("relative_name", relative_name))
{
 ... 
}

I expect that if my global name is /bla and my param is /bla/param1. I could simply use the second if loop with getParam("param1",relative_name), But this doesn't work.

here is the solution which requires you to instantiate a private node handle.

My question now is what does the tutorial mean then by relative name ? and relative to what ? because it doesn't work relative to my node name.

2018-03-11 01:53:21 -0500 received badge  Student (source)
2018-03-11 01:52:58 -0500 received badge  Notable Question (source)
2018-03-11 01:52:58 -0500 received badge  Popular Question (source)
2018-02-18 14:54:36 -0500 received badge  Famous Question (source)
2018-02-18 14:54:36 -0500 received badge  Notable Question (source)
2017-09-06 09:01:47 -0500 received badge  Famous Question (source)
2017-07-30 12:42:48 -0500 received badge  Famous Question (source)
2017-06-05 23:26:39 -0500 received badge  Famous Question (source)
2017-06-05 23:26:39 -0500 received badge  Notable Question (source)
2017-04-20 08:20:04 -0500 received badge  Notable Question (source)
2017-04-20 00:29:33 -0500 received badge  Notable Question (source)
2016-11-21 07:43:25 -0500 commented answer Nodelet Publisher

As you suggested I used createTimer and in that i could specify the frequency using ros::Duration

2016-11-21 07:42:12 -0500 received badge  Popular Question (source)
2016-11-21 04:12:58 -0500 commented answer ‘getPrivateNodeHandle’ and ‘getNodeHandle’ as class constructor parameters

I have been searching for hrs for this "pretty basic C++" rule that doesn't allow "definition of the member variable by calling functions" as I interpret what you are trying to say from your statement above. I agree what you are saying maybe totally true. But I would have loved to see some definitio

2016-11-20 13:43:32 -0500 commented answer Nodelet Publisher

I would require 36Hz frequency of published messages, do you advice using a timer ? or do you see any problems arising ?

2016-11-20 13:39:32 -0500 received badge  Commentator
2016-11-20 13:39:32 -0500 commented question classes inside nodelet (NodeHandle)

yes the getNodeHandle() doesn't compile because I think it needs to be derived class from the nodelet class I am not so sure if this is the reason though. Anyway, I know decided to pass the nodehandles into the sub-classes from the nodelet. This seems to be the convention followed.

2016-11-18 12:52:48 -0500 received badge  Popular Question (source)
2016-11-18 09:57:10 -0500 asked a question Nodelet Publisher
 virtual void onInit()
{
    ros::NodeHandle & private_nh = getPrivateNodeHandle();
    pub = private_nh.advertise<nodelet_test::buff>("chatter2", 10);
    nodelet_test::buff buffer;
    buffer.buffer_data.push_back(20);
    while(ros::ok())
    {
        pub.publish(buffer);
    }

}

I have the example code above for nodelet publisher only. Since I do not use callbacks (no subscriber ), is the way its done ? adding while loop inside onInit () ?

2016-11-18 05:19:01 -0500 asked a question Boost shared pointer publishing - zero copy

Hello Community,

I have read that the intra process communication can be done by publishing message using boost shared pointer of the message. Then there is zero copy. Apparentely this is what makes nodelets so powerful.

  1. My question now, is this valid only for nodelets that we should publish using pointers and there is zero copy ? Is this also true between different nodes ?

  2. Also is there a requirement that the nodelets be launched from the same nodelet manager for the zero copy to be true ?

  3. Is there a way to check/test whether there is zero copy happening in my implementation or my code is using network resources ?
2016-11-18 02:24:17 -0500 commented answer ‘getPrivateNodeHandle’ and ‘getNodeHandle’ as class constructor parameters

I moved the constructor from the private to the onInit() region as is. And it works now, there was nothing wrong with the constructor, but I guess getNodeHandle() is inside onInit() and does not exist outside it. Although I can't find documentation that says so.

2016-11-17 08:07:36 -0500 received badge  Popular Question (source)
2016-11-17 04:59:48 -0500 commented answer ‘getPrivateNodeHandle’ and ‘getNodeHandle’ as class constructor parameters

Sorry for the poor description. I have edited my description, does it help ?

2016-11-16 10:16:11 -0500 asked a question ‘getPrivateNodeHandle’ and ‘getNodeHandle’ as class constructor parameters

Hello,

I have the following constructor for a non nodelet class.

 Chor::Chor(ros::NodeHandle &_nh , ros::NodeHandle &_nhPriv):nh_(_nh),nhPriv_(_nhPriv)
 {
 }

I want to pass nodeHandle from the nodelet to the class above. The class above is instatiated as private inside the nodelet. In my nodelet class I do

 private:
 Chor chor_nodelet(getNodeHandle(),getPrivateNodeHandle());

onInit()
{ ..
 }

But I get the following error

error: ‘getNodeHandle’ is not a type
error: ‘getPrivateNodeHandle’ is not a type

What is wrong here ?

2016-11-16 07:02:31 -0500 asked a question classes inside nodelet (NodeHandle)

Hello,

In my node I have several classes which I called from the main()

Then inside these classes constructor I simply use

nh_(ros::this_node::getName())
ros::NodeHandle nhPriv("~");

#################################

Now I convert this main() into a nodelet. The nh_ and nhPriv inside classes doesn't work because its not a node but a nodelet.

what is the best way to get nodeHandles inside these classes ?

I am dreading making these several classes into nodelets, is there a better way ?

2016-11-15 00:38:39 -0500 received badge  Famous Question (source)
2016-11-14 09:06:32 -0500 marked best answer nodelet: Publisher subscriber

I have seen the basic working of the nodelets and even read the instruction how to port your class to nodelet. But I don't know how to make my publisher subscriber nodes into nodelet. Once of the instruction is delete the main() and put the constructor into the init(). So then where does the publisher while loop go then ? and where is my subscriber supposed to do the callback ? I am completely confused. Does anyone have a minimum working example for publisher subscriber nodelets ? Or any tips on how to do this task ?

2016-11-14 09:06:21 -0500 answered a question nodelet: Publisher subscriber

This book below has some good examples:

Mastering ROS for Robotics Programming By Lentin Joseph

To answer my own question in short, there are no while loops or spin() and spinOnce() this is taken care of by the nodelet manager.

2016-11-09 09:47:46 -0500 asked a question subfolders in msg folder

Is it possible to have subfolders inside msg/ folder ?

I have:

msg/fold1 with 1.msg 2.msg 3.msg

msg/fold2 with 4.msg 5.msg

1.msg contains 2.msg but is given the error no 2.msg in 'msg/' folder it doesnt search inside the 'msg/fold1' folder.

My CMakeLists.txt add_message_files(

FILES

msg/fold1/1.msg

msg/fold1/2.msg

msg/fold1/3.msg

msg/fold2/4.msg

msg/fold3/5.msg )

2016-11-09 04:58:03 -0500 received badge  Notable Question (source)
2016-11-04 05:07:45 -0500 received badge  Famous Question (source)
2016-11-04 05:07:38 -0500 received badge  Famous Question (source)
2016-11-03 11:16:29 -0500 commented answer nodelet: Publisher subscriber

I have seen the link it doesn't solve either of my doubts on what to do with my ros::while loops and what happens to the subscriber and publisher spin and spinOnce. I want to have them as two separate nodelets. Anyways I will ask some friends here next week.

2016-11-03 11:15:05 -0500 received badge  Popular Question (source)