ROS(Robot Operating System)

[ROS2] 파이썬 setup.py의 entry_points 명령 규칙

COSMOSRKSI 2022. 4. 12. 15:30

ros2 run 커맨드로 패키지를 실행하기 위해서는 setup.py에서 entry_points를 지정 해야한다.

가령 아래와 같은 entry_points가 있다고 가정하자.

 

 
 
entry_points={
'console_scripts': [
'py_pub_topic = py_topic.py_pub_topic:main',
'py_sub_topic = py_topic.py_sub_topic:main',
],
 
 
executable_name = package_name.source_file_name:method_name(inside source file)

여기서 py_pub_topic = py_topic.pub_topic:main은 아래와 같이 대응된다.

 

 

여기서 파일이름은 main이 선언된 파일을 말함