STELLA_N1 키보드 기반 구동이 안됩니다. > STELLA_N1_Forum

본문 바로가기
사이트 내 전체검색

STELLA_N1_Forum

STELLA_N1 키보드 기반 구동이 안됩니다.

페이지 정보

profile_image
작성자 shshin
댓글 33건 조회 518회 작성일 24-07-19 14:39

본문

STELLA N1 SBC 버전:
- Board : Raspberry pi4
- image : ideaRobot 제공 이미지

REMOTE PC 버전: Ubuntu 22.04

ROS 버전: ROS2-Humble

ideaRobot의 gitbook에 나와있는 Manual대로 모두 진행하였습니다.

현재 상태
- ls -la /dev/를 실행하였을 때 MW, LiDAR 등 정상적으로 생성되었음을 확인
- 원격 PC에서 Raspberry pi와 SSH 연결 완료
- ros2 topic list 명령어를 통해 cmd_vel이라는 Topic이 제대로 전달 됨을 확인
- NTREX를 통해 Motor가 정상적으로 구동되는 것을 확인
(위 상태에 대한 결과 사진은 zip파일로 첨부하였습니다.)

=> 이 모든 상태에서 원격PC를 통해 키보드로 wsad 입력 값을 전달했을 때 모터 구동 안됨

추가로 App으로도 구동했을 때 STELLA_N1 구동 안됨

첨부파일

댓글목록

profile_image

최고관리자님의 댓글

최고관리자 작성일

안녕하세요.

아이디어 로봇입니다.

ros2 topic list를 어떤 터미널에서 실행하셨나요?
원격PC의 터미널에서 실행하신 경우 통신을 확인하실 수 없습니다.

ROS_DOMAIN_ID가 다른 경우 topic 통신이 제대로 이루어 지지 않을 수 있습니다.

원격PC와 SBC(라즈베리파이)의 .bashrc파일에 ROS_DOMAIN_ID를 추가하셔서 확인 부탁 드립니다.

profile_image

shshin님의 댓글

shshin 작성일

Topic 확인할 때 원격PC에서 SSH 연결한 뒤에 명령어를 통해 Topic list를 확인했고 그 내에 cmd_vel이라는 Topic이 있는 걸 확인한 상태입니다.
답변 남겨주신 글 중에서 bashrc는 어떤 bashrc파일을 말씀하시는 건지 답변 부탁드립니다.

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

.bashrc파일은 각 PC의 home 디렉터리에 있습니다.

새 터미널을 열었을 때 ls -a 명령어로 확인하실 수 있습니다.

라즈베리파이의 터미널에서 cmd_vel이 확인되었다면 토픽은 전달 되어 있을 것으로 확인됩니다.

원격 PC에서 rqt_graph를 통해 토픽이 노드에 잘 연결되어 있는지 확인이 필요할 것 같습니다.
rqt_graph를 실행하신 화면을 캡쳐하여 보여주시면 감사하겠습니다.

profile_image

shshin님의 댓글

shshin 작성일

추가적으로 ros2 launch stella_teleop_bluetooth stella_teleop_bluetooth.launch.py 명령어 실행 시
colcon_ws/install...파일에 있는 stella_teleop_bluetooth에서 stella_teleop_bluetooth.launch.py 아니라 stella_teleop_bluetooth을 찾습니다. 이 경로를 수정해야 하는데 어떻게 수정해야하는 지에 대한 문의 남깁니다.

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

우선 colcon_ws의 install, build 디렉터리를 삭제하시고 colcon build로 다시 빌드하여 테스트 하여 보시고

만약 다시 문제가 발생한다면 에러 로그를 함께 보여주시면 확인하여 답변 드리겠습니다.

profile_image

shshin님의 댓글의 댓글

shshin 작성일

이렇게 실행해보았지만 아래와 같은 결과가 나옵니다.
ros2 launch stella_teleop_bluetooth stella_teleop_bluetooth.launch.py
Package 'stella_teleop_bluetooth' not found: "package 'stella_teleop_bluetooth' not found, searching: ['/home/pi/humble_ws/install/vision_opencv', '/home/pi/humble_ws/install/image_transport_plugins', '/home/pi/humble_ws/install/theora_image_transport', '/home/pi/humble_ws/install/opencv_tests', '/home/pi/humble_ws/install/joint_state_publisher_gui', '/home/pi/humble_ws/install/joint_state_publisher', '/home/pi/humble_ws/install/image_common', '/home/pi/humble_ws/install/compressed_image_transport', '/home/pi/humble_ws/install/compressed_depth_image_transport', '/home/pi/humble_ws/install/image_transport', '/home/pi/humble_ws/install/image_geometry', '/home/pi/humble_ws/install/cv_bridge', '/home/pi/humble_ws/install/camera_info_manager', '/home/pi/humble_ws/install/camera_calibration_parsers', '/opt/ros/humble']"

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

패키지 위치를 찾지 못하고 있는 것 같습니다.

우선 아래 두 명령어를 실행하여 주시고 같은 결과가 발생하는지 확인하여 주세요.
source ~/colcon_ws/install/setup.bash
source ~/colcon_ws/install/local_setup.bash

profile_image

shshin님의 댓글의 댓글

shshin 작성일

둘다 아무런 결과가 나타나지 않습니다

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

해당 두 명령어는 빌드한 패키지를 ros2가 찾을 수 있도록 설정을 적용 시켜주는 역할을 하는 명령어로 직접적인 결과가 나오지 않습니다.

해당 두 명령어를 실행하신 후 launch를 다시 실행하여 주세요.

profile_image

shshin님의 댓글

shshin 작성일

원격PC에서 rqt_graph 명령어 실행 시 아래와 같은 에러가 발생하고 그래프는 나타나지 않습니다.

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-name'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-name'
libGL error: glx: failed to create dri3 screen
libGL error: failed to load driver: nouveau
libGL error: failed to get magic
libGL error: failed to load driver: nouveau

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

그래픽 관련된 문제로 예상됩니다.
자세한 원인 파악을 위해 사용하시는 원격PC의 사양 정보가 필요할 것 같습니다.

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

rqt_graph로 노드 통신을 확인하기 위해 우선 원격PC의 그래픽 문제를 해결하여야 합니다.

어떤 종류의 PC로 원격PC를 사용하고 계시는지 먼저 알려주시면 해결 방법을 확인하여 보겠습니다.

profile_image

shshin님의 댓글

shshin 작성일

추가적으로 원격 PC에서 colcon build --symlink-install를 실행했을 때
Summary: 4 packages finished [3.86s]
  1 package had stderr output: stella_teleop
위와 같은 결과가 출력되는 데 이 결과가 키보드 제어가 제대로 안되는 데에 원인이 되나요? 원인이 된다면 이 문제를 어떻게 하는 지에 대해 여쭈어보고 싶습니다.

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

Summary: 4 packages finished는 문제 없이 네 개의 패키지 빌드가 끝났다는 로그입니다.
1 package had stderr output: stella_teleop는 경고, 에러 로그가 빌드 중 발생하였다는 로그로 위의 빌드 완료 로그와 함께 나오는 경우 경고 로그일 가능성이 높고 큰 문제가 되지 않습니다.

자세한 내용은 경고 에러에 해당하는 로그를 확인하여 보아야 알 수 있을 것 같습니다.

profile_image

shshin님의 댓글

shshin 작성일

source ~/colcon_ws/install/setup.bash source ~/colcon_ws/install/local_setup.bash 이후
launch를 다시 실행했을 때 file 'stella_teleop_bluetooth.launch.py' was not found in the share directory of package 'stella_teleop_bluetooth' which is at '/home/pi/colcon_ws/install/stella_teleop_bluetooth/share/stella_teleop_bluetooth'라는 결과가 나왔습니다. 하지만 '/home/pi/colcon_ws/install/stella_teleop_bluetooth/share/stella_teleop_bluetooth'에 있는 stella_teleop_bluetooth.launch.py의 파일 명에 오타가 있어 수정 후 실행했더니 아래와 같은 에러가 발생했습니다.
[ERROR] [stella_teleop_bluetooth_node-1]: process has died [pid 3119, exit code 1, cmd '/home/pi/colcon_ws/install/stella_teleop_bluetooth/lib/stella_teleop_bluetooth/stella_teleop_bluetooth_node --ros-args -r __node:=stella_teleop_bluetooth_node'].

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

프로세스가 종료된 로그는 확인되지만 종료된 이유는 이전 로그를 확인하여 보아야 할 것 같습니다.

로그를 보여주실 때 전체 로그를 보내주세요.

profile_image

shshin님의 댓글의 댓글

shshin 작성일

ros2 launch stella_teleop_bluetooth stella_teleop_bluetooth.launch.py
[INFO] [launch]: All log files can be found below /home/pi/.ros/log/2024-07-22-15-36-13-535094-raspberrypi-3118
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [stella_teleop_bluetooth_node-1]: process started with pid [3119]
[stella_teleop_bluetooth_node-1] Traceback (most recent call last):
[stella_teleop_bluetooth_node-1]  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 322, in open
[stella_teleop_bluetooth_node-1]    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
[stella_teleop_bluetooth_node-1] PermissionError: [Errno 13] Permission denied: '/dev/BT'
[stella_teleop_bluetooth_node-1]
[stella_teleop_bluetooth_node-1] During handling of the above exception, another exception occurred:
[stella_teleop_bluetooth_node-1]
[stella_teleop_bluetooth_node-1] Traceback (most recent call last):
[stella_teleop_bluetooth_node-1]  File "/home/pi/colcon_ws/install/stella_teleop_bluetooth/lib/stella_teleop_bluetooth/stella_teleop_bluetooth_node", line 33, in <module>
[stella_teleop_bluetooth_node-1]    sys.exit(load_entry_point('stella-teleop-bluetooth', 'console_scripts', 'stella_teleop_bluetooth_node')())
[stella_teleop_bluetooth_node-1]  File "/home/pi/colcon_ws/build/stella_teleop_bluetooth/stella_teleop_bluetooth/stella_teleop_bluetooth.py", line 75, in main
[stella_teleop_bluetooth_node-1]    teleop_bluetooth = TeleopBluetooth()
[stella_teleop_bluetooth_node-1]  File "/home/pi/colcon_ws/build/stella_teleop_bluetooth/stella_teleop_bluetooth/stella_teleop_bluetooth.py", line 13, in __init__
[stella_teleop_bluetooth_node-1]    self.serial_port = serial.Serial(
[stella_teleop_bluetooth_node-1]  File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 244, in __init__
[stella_teleop_bluetooth_node-1]    self.open()
[stella_teleop_bluetooth_node-1]  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 325, in open
[stella_teleop_bluetooth_node-1]    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
[stella_teleop_bluetooth_node-1] serial.serialutil.SerialException: [Errno 13] could not open port /dev/BT: [Errno 13] Permission denied: '/dev/BT'
[ERROR] [stella_teleop_bluetooth_node-1]: process has died [pid 3119, exit code 1, cmd '/home/pi/colcon_ws/install/stella_teleop_bluetooth/lib/stella_teleop_bluetooth/stella_teleop_bluetooth_node --ros-args -r __node:=stella_teleop_bluetooth_node'].

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

launch는 잘 실행되었지만 블루투스 모듈 연결이 제대로 되어 있지 않은 것 같습니다.

먼저 블루투스 모듈을 확인하여 주시고
ls -la /dev 명령어를 사용하셨을 때 BT가 있는지 확인하여 주세요.

profile_image

shshin님의 댓글의 댓글

shshin 작성일

lrwxrwxrwx  1 root root          5 Jul 22 14:52 BT -> ttyS0
BT 연결되어 있습니다

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

sudo chmod 666 /dev/ttyS0
명령어로 접근 권한을 추가하여 주시고 다시 실행하여 주세요.

profile_image

shshin님의 댓글

shshin 작성일

sudo chmod 666 /dev/ttyS0 실행 후 APP으로 블루투스 연결 후 조작했을 때 로봇 구동이 안됩니다.

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

네 그러면 블루투스 부분은 해결된 것 같습니다.
구동은 이전의 teleop문제와 같은 문제일 것으로 보입니다.

해당 문제를 우선 해결하여야 합니다.

profile_image

shshin님의 댓글의 댓글

shshin 작성일

그 문제를 해결하기 위해 위에서 제시해주신 방법들 진행했는데 그 다음엔 뭘 진행하면 될까요?

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

원격 PC 사양, 빌드 로그 관련으로 아직 답변해주시지 않으셔서 다음 진행 방법을 저희가 확인할 수 없습니다.

profile_image

shshin님의 댓글의 댓글

shshin 작성일

빌드 로그는 어떤 부분 말씀하시는걸까요?

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

각각 13시56분, 14시26분에 남겨주신 댓글에 답변 남긴 내용입니다.

profile_image

shshin님의 댓글

shshin 작성일

빌드 로그입니다.
Starting >>> stella_cartographer
Starting >>> stella_description
Starting >>> stella_navigation2
Starting >>> stella_teleop
Finished <<< stella_navigation2 [0.55s]                                 
Finished <<< stella_cartographer [0.57s]
Finished <<< stella_description [0.57s]
--- stderr: stella_teleop                 
/home/name/.local/lib/python3.10/site-packages/setuptools/command/develop.py:42: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  easy_install.initialize_options(self)
---
Finished <<< stella_teleop [1.55s]

Summary: 4 packages finished [1.73s]
  1 package had stderr output: stella_teleop

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

해당 경고 메시지의 경우 현재 ROS2에서 사용하는 build 방식이 최신 파이썬 방식과 차이가 있어 발생하는 경고이며
ROS의 방식이 지원 종료된 것이 아니기 때문에 문제가 되지 않습니다.

해당 경고가 나오지 않도록 하기 위해서는 setuptools의 버전을 58.2.0으로 고정하여 주시면 됩니다.
아래 명령어를 사용하시면 됩니다.
pip install setuptools==58.2.0

profile_image

shshin님의 댓글

shshin 작성일

답변 주신대로 실행 후 다시 colcon build를 진행하니 아래와 같은 결과가 나왔습니다.
colcon build --symlink-install
Starting >>> stella_cartographer
Starting >>> stella_description
Starting >>> stella_navigation2
Starting >>> stella_teleop
Finished <<< stella_description [0.51s]                                 
Finished <<< stella_navigation2 [0.52s]
Finished <<< stella_cartographer [0.53s]
Finished <<< stella_teleop [1.22s]         

Summary: 4 packages finished [1.49s]
이후 다시 ros2 run stella_teleop teleop_keyboard를 실행해보았지만 여전히 key를 입력해도 로봇이 구동되지 않습니다.'

그리고 혹시 이런 teleop 문제들이 SBC의 img 파일과 관련 없는게 맞을까요?

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

어제 답변 드린대로 해당 로그는 경고 로그이며 해결하여도 변경되는 점이 없습니다.

원격PC 관련 답변을 확인 하여 주시기 바랍니다.

profile_image

shshin님의 댓글의 댓글

shshin 작성일

원격 PC는 회사 보안 PC라 알려드릴 수가 없습니다

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

해당 PC가 노트북인지 가상 환경인지 혹은 다른 SBC인지 이러한 부분도 공유가 불가능한가요?

profile_image

최고관리자님의 댓글의 댓글

최고관리자 작성일

아무런 정보도 공유가 불가능하시다면 그래픽 문제를 직접 해결하신 후에 teleop관련 도움을 드릴 수 있을 것 같습니다.

회원로그인

회원가입