ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can achieve what you want with passing points as string of arrays to the launch file.
For roslaunch args, see reference
My approach would be something like this:
$ roslaunch render_points array.launch points:="[11, 12, 13], [21, 22, 23], [31, 32, 33], [41, 42, 43]"
#!/usr/bin/env python
import rospy
if __name__=="__main__":
rospy.init_node("list_points")
points = rospy.get_param("~points", None)
points = [[int(x.strip(' ')) for x in ss.lstrip(' [,').split(', ')] for ss in points.rstrip(']').split(']')]
print(points[0])
rospy.spin()
<?xml version="1.0"?>
<launch>
<arg name="points" doc="description for this arg"/>
<node pkg="render_points" type="list_points.py" name="list_points" output="screen">
<param name="points" value="$(arg points)"/>
</node>
</launch>
2 | No.2 Revision |
You can achieve what you want with passing points as string of arrays to the launch file.
For roslaunch args, see reference
My approach would be something like this:
$ roslaunch render_points array.launch points:="[11, 12, 13], [21, 22, 23], [31, 32, 33], [41, 42, 43]"
#!/usr/bin/env python
import rospy
if __name__=="__main__":
rospy.init_node("list_points")
points = rospy.get_param("~points", None)
points = [[int(x.strip(' ')) for x in ss.lstrip(' [,').split(', ')] for ss in points.rstrip(']').split(']')]
print(points[0])
rospy.spin()
<?xml version="1.0"?>
<launch>
<arg name="points" doc="description for this arg"/>
<node pkg="render_points" type="list_points.py" name="list_points" output="screen">
<param name="points" value="$(arg points)"/>
</node>
</launch>
3 | No.3 Revision |
You can achieve what you want with passing points as string of arrays to the launch file.
For roslaunch args, see reference
My approach would be something like this:
$ roslaunch render_points array.launch points:="[11, 12, 13], [21, 22, 23], [31, 32, 33], [41, 42, 43]"
#!/usr/bin/env python
import rospy
if __name__=="__main__":
rospy.init_node("list_points")
points = rospy.get_param("~points", None)
points = [[int(x.strip(' ')) for x in ss.lstrip(' [,').split(', ')] for ss in points.rstrip(']').split(']')]
print(points[0])
rospy.spin()
<?xml version="1.0"?>
<launch>
<arg name="points" doc="description for this arg"/>
<node pkg="render_points" type="list_points.py" name="list_points" output="screen">
<param name="points" value="$(arg points)"/>
</node>
</launch>