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이 선언된 파일을 말함
'ROS(Robot Operating System)' 카테고리의 다른 글
라즈베리 파이 4 우분투 20.04 데스크탑 버전 설치 후 WiFi 연결 안되는 문제 해결에 대하여 (0) | 2025.01.10 |
---|---|
ROS, anaconda 설치 후 패키지 실행 시 ImportError: No module named yaml 에러 발생 시 해결 방법 (0) | 2024.07.28 |
ROS_DISTRO was set to 'noetic' before 문제 해결 방법 (0) | 2024.01.24 |
turtlebot3(터틀봇3)에 Humble 설치 시 유의사항 (1) | 2023.06.27 |
ydlidar x4 Error, cannot retrieve YDLidar health code: ffffffff 해결방법 (0) | 2023.03.07 |