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

vbplaya's profile - activity

2022-08-03 12:08:08 -0500 received badge  Enthusiast
2022-08-01 19:03:32 -0500 answered a question ROS Melodic no longer finding python scripts

BLUF: Melodic uses Python 2 which requires a __init__.py file in each folder containing python scripts. I found out wha

2022-08-01 19:03:32 -0500 received badge  Rapid Responder (source)
2022-08-01 14:06:05 -0500 asked a question ROS Melodic no longer finding python scripts

ROS Melodic no longer finding python scripts NOTE: Working in Windows (I have to because this is the machine that my wor

2014-08-08 02:32:53 -0500 received badge  Famous Question (source)
2014-08-07 16:01:49 -0500 commented answer roslaunch file using rosparam

I finally figured out how to put the code in without messing up when using the greater than or less than symbols! That took a while ... sadly. Thanks for your help. Do you have any idea on the second part of my question about how I can assign the args by means of the rosparam yaml file I load?

2014-08-07 16:00:00 -0500 commented answer roslaunch file using rosparam

Apparently the way I had it coded originally was correct (see original question). The reason it was failing was due to it adding a couple args ("__name:" and "__log:"). This caused a problem with my code which looks for the correct number of args. Thanks for your help.

2014-08-07 15:36:29 -0500 received badge  Editor (source)
2014-08-07 15:35:04 -0500 commented answer roslaunch file using rosparam

My code accounted for too few and too many args ... so I thought it was exiting because it had 0 args when it was actually because of too many.

2014-08-07 15:34:00 -0500 commented answer roslaunch file using rosparam

It turns out my code was correct already (exactly yours shown above). Problem was that when you add the "args" line to the code it sends the args you entered along with 2 others: "__name:=FOO1" and "__log:= ...". I had code in the other files which verified correct # of args.

2014-08-07 15:28:51 -0500 received badge  Scholar (source)
2014-08-07 12:08:09 -0500 commented answer roslaunch file using rosparam

See http://wiki.ros.org/roslaunch/XML

Half way down page in "A More Complicated Example"
comment: Pass args to the listener node

<node name="listener-2" pkg="rospy_tutorials" type="listener" args="-foo arg2"/>

2014-08-07 12:07:35 -0500 commented answer roslaunch file using rosparam

I agree I should know ... and I do. I just feel that it should be more straight forward approach which doesn't involve changing code to accommodate my launch file. I found on the ROSwiki "how" to do it but I've got it exactly this way and it isn't working. See next comment (comments are too short)

2014-08-07 11:29:20 -0500 received badge  Notable Question (source)
2014-08-07 11:17:08 -0500 commented answer roslaunch file using rosparam

It just seems like if I can call a node from the terminal

rosrun foo_pkg foo_node 1 192.168.100.10

without any knowledge of internal code parameter names. I should be able to do it in the launch file that way as well. Maybe a system call from inside the launch file would work?

2014-08-07 11:06:08 -0500 commented answer roslaunch file using rosparam

This is how it is done on a regular basis? It seems excessive to have to go into my source code for each of my packages and add the above code replacing my normal:
int main (int argc, char *argv[])
{
ipAdd = argv[1];
...
}

2014-08-07 10:56:41 -0500 commented answer roslaunch file using rosparam

Actually, I already had it exactly like this ... I just don't know how to put the greater than and less than symbols in message without it thinking it is actual xml code to execute.

2014-08-07 02:31:10 -0500 received badge  Popular Question (source)
2014-08-06 19:10:10 -0500 edited question roslaunch file using rosparam

I'm trying to write a roslaunch file which opens a few nodes with unique ip addresses which are provided in a yaml file. If I wanted to start each one using terminals for each I would type it in as follows:

rosrun foo_pkg foo_node 1 192.168.100.10
rosrun foo_pkg foo_node 2 192.168.100.20

I want to be able to open them all in one launch file:

FIRST TRY SIMPLY CODING INTO LAUNCH FILE:

     <launch>
       <node   name="FOO1"
               pkg="foo_pkg"
               type="foo_node"
               args="1 192.168.100.10"
               output="screen"/>
       <node   name="FOO2"
               pkg="foo_pkg"
               type="foo_node"
               args="2 192.168.100.20"
               output="screen"/>
     </launch>
This didn't work, I guess I can't put the arguments in this way but don't know how to put them in correctly. **In the end I want it to get these values from a launch file like below:**
     ip:  
       board1:  
         num: 1  
         address: '192.168.10.10'  
       board2:  
         num: 2  
         address: '192.168.10.20'

So my main question is ... HOW CAN I USE THE ROSPARAMS INSIDE THE ROSLAUNCH FILE TO PROPERLY LAUNCH THEM?