Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- turtlebot
- autorace
- Gazebo
- FreeCAD
- 전이학습
- sources.list
- darknet_ros
- webots
- ax200
- rqt
- G++
- turtlebot3
- CUDA
- Kinetic
- RGB-D
- 부분공간
- opencv
- 촉각센서
- amcl
- error
- Linux
- linetracing
- CuDNN
- gcc
- roslib
- ROS
- YoLO
- ubuntu
- Installation
- roslaunch
Archives
- Today
- Total
기술 성공, 실패 기록소
param과 args에 대해서. 본문
728x90
roslaunch에서
<node ... args="$(arg filename)" ... />
c++에선 main 함수 내에서
argv[1] 로 filename에 접근해야함.
nh.getParam("filename", filename) 과 같이 접근하려면
roslaunch에서
<arg name="filename" />
<param name="filename" type="string" value="$(arg filename)" />
다음과 같은 식으로 param tag를 사용해 줘야함.
command line으로 arg value를 넣을 땐
roslaunch webots_ros play_motion.launch filename:=motion_001
위와 같은 식으로 해줘야 하고.
그러니까 c++에서 getParam을 사용하기 위해선
roslaunch에서 param tag를 사용해야 하고
command line에서는 arg value를
roslaunch 의 arg tag로 전달 할 수 있다.
'프로그래밍언어 > ROS' 카테고리의 다른 글
[ROS] Include a Cpp header from another package (0) | 2022.04.06 |
---|---|
generic path to read a file in a ROS directory (0) | 2022.03.10 |
rosbag , topic 저장 (0) | 2021.12.01 |
decompress 16bit grey scale depth compressed image (0) | 2021.08.20 |
imdecode (0) | 2021.08.18 |