ROBOTIS-GIT / turtlebot3

ROS packages for Turtlebot3
http://turtlebot3.robotis.com
Apache License 2.0
1.45k stars 1k forks source link

Can't setup OpenCR in ROS2 Humble #943

Open Newmodel-YUKECHI opened 1 year ago

Newmodel-YUKECHI commented 1 year ago
  1. Which TurtleBot3 platform do you use?

    • [ ] Waffle Pi
  2. Which ROS is working with TurtleBot3?

    • [ ] ROS 2 Humble
  3. Which SBC(Single Board Computer) is working on TurtleBot3?

    • [ ] ubuntu 22.04
  4. Which OS you installed on SBC?

    • [ ] ubuntu 22.04
  5. Which OS you installed on Remote PC?

    • [ ] ubuntu 22.04
  6. Specify the software and firmware version(Can be found from Bringup messages)

    • Software version: [x.x.x]
    • Firmware version: [x.x.x]
  7. Specify the commands or instructions to reproduce the issue.

    • launch# ros2 launch turtlebot3_bringup robot.launch.py
  8. Copy and Paste the error messages on terminal.

[INFO] [launch]: All log files can be found below /root/.ros/log/2023-03-22-05-35-27-420981-yuki-Lenovo-IdeaPad-L340-15API-9001 [INFO] [launch]: Default logging verbosity is set to INFO urdf_file_name : turtlebot3_waffle_pi.urdf [INFO] [robot_state_publisher-1]: process started with pid [9007] [INFO] [hlds_laser_publisher-2]: process started with pid [9009] [INFO] [turtlebot3_ros-3]: process started with pid [9011] [robot_state_publisher-1] [INFO] [1679463327.816807432] [robot_state_publisher]: got segment base_footprint [robot_state_publisher-1] [INFO] [1679463327.820216057] [robot_state_publisher]: got segment base_link [turtlebot3_ros-3] [INFO] [1679463327.820143279] [turtlebot3_node]: Init TurtleBot3 Node Main [turtlebot3_ros-3] [INFO] [1679463327.820665647] [turtlebot3_node]: Init DynamixelSDKWrapper [hlds_laser_publisher-2] [INFO] [1679463327.821195907] [hlds_laser_publisher]: Init hlds_laser_publisher Node Main [hlds_laser_publisher-2] [INFO] [1679463327.821513211] [hlds_laser_publisher]: port : /dev/ttyUSB0 frame_id : base_scan [robot_state_publisher-1] [INFO] [1679463327.824533919] [robot_state_publisher]: got segment base_scan [robot_state_publisher-1] [INFO] [1679463327.824570727] [robot_state_publisher]: got segment camera_link [robot_state_publisher-1] [INFO] [1679463327.824595941] [robot_state_publisher]: got segment camera_rgb_frame [robot_state_publisher-1] [INFO] [1679463327.824619827] [robot_state_publisher]: got segment camera_rgb_optical_frame [robot_state_publisher-1] [INFO] [1679463327.824644692] [robot_state_publisher]: got segment caster_back_left_link [robot_state_publisher-1] [INFO] [1679463327.824669976] [robot_state_publisher]: got segment caster_back_right_link [robot_state_publisher-1] [INFO] [1679463327.824697564] [robot_state_publisher]: got segment imu_link [robot_state_publisher-1] [INFO] [1679463327.824722709] [robot_state_publisher]: got segment wheel_left_link [robot_state_publisher-1] [INFO] [1679463327.824745059] [robot_state_publisher]: got segment wheel_right_link [turtlebot3_ros-3] [INFO] [1679463327.825697459] [DynamixelSDKWrapper]: Succeeded to open the port(/dev/ttyACM0)! [turtlebot3_ros-3] [INFO] [1679463327.839946941] [DynamixelSDKWrapper]: Succeeded to change the baudrate! [turtlebot3_ros-3] [ERROR] [1679463327.874348608] [turtlebot3_node]: Failed connection with Devices [turtlebot3_ros-3] [INFO] [1679463327.875894618] [turtlebot3_node]: Add Motors [turtlebot3_ros-3] [INFO] [1679463327.876006648] [turtlebot3_node]: Add Wheels [turtlebot3_ros-3] [INFO] [1679463327.876042409] [turtlebot3_node]: Add Sensors [turtlebot3_ros-3] terminate called after throwing an instance of 'rclcpp::exceptions::RCLError' [turtlebot3_ros-3] what(): could not create publisher: rcl node's context is invalid, at ./src/rcl/node.c:428 [ERROR] [hlds_laser_publisher-2]: process has died [pid 9009, exit code 255, cmd '/opt/ros/humble/lib/hls_lfcd_lds_driver/hlds_laser_publisher --ros-args -r __node:=hlds_laser_publisher --params-file /tmp/launch_params__fbjdohz']. [ERROR] [turtlebot3_ros-3]: process has died [pid 9011, exit code -6, cmd '/opt/ros/humble/lib/turtlebot3_node/turtlebot3_ros -i /dev/ttyACM0 --ros-args --params-file /opt/ros/humble/share/turtlebot3_bringup/param/waffle_pi.yaml'].

  1. Please describe the issue in detail.

    • In line 25, [turtlebot3_node]: Failed connection with Devices
    • In line 31, [hlds_laser_publisher-2]: process has died [pid 9009, exit code 255, cmd '/opt/ros/humble/lib/hls_lfcd_lds_driver/hlds_laser_publisher --ros-args -r __node:=hlds_laser_publisher --params-file /tmp/launch_params__fbjdohz'].
    • In line 32, [turtlebot3_ros-3]: process has died [pid 9011, exit code -6, cmd '/opt/ros/humble/lib/turtlebot3_node/turtlebot3_ros -i /dev/ttyACM0 --ros-args --params-file /opt/ros/humble/share/turtlebot3_bringup/param/waffle_pi.yaml'].
    • we can't set up OpenCR cause of above errors.
ROBOTIS-Will commented 1 year ago

@Newmodel-YUKECHI It looks like your LDS setup is incorrect. Please make sure to export the correct LDS model in your ~/.bashrc file as shown in the emanual.

LDS-01 LDS-02
   

Setting up the LDS-02 on Raspberry Pi is shown below.

$ sudo apt update
$ sudo apt install libudev-dev
$ cd ~/turtlebot3_ws/src
$ git clone -b ros2-devel https://github.com/ROBOTIS-GIT/ld08_driver.git
$ cd ~/turtlebot3_ws/src/turtlebot3 && git pull
$ rm -r turtlebot3_cartographer turtlebot3_navigation2
$ cd ~/turtlebot3_ws && colcon build --symlink-install
$ echo 'export LDS_MODEL=LDS-02' >> ~/.bashrc
$ source ~/.bashrc
shiba-8ro commented 1 year ago

In addition, Turtlebot3 Kit included LiDAR that sold in Japan from the second half of 2022 is LDS-02.

bastinat0r commented 1 year ago

I have the same issue. I have the old LDS and set the variable as follows: export LDS_MODEL=LDS1. As far as I can tell, the laser scanner is not the issue, but the OpenCR board is behaving badly. You can see how my turtlebots are set up with an ansible script from this repo: https://github.com/ovgu-FINken/driving_swarm_ansible

bastinat0r commented 1 year ago

Update: I connected the OpenCR board from another robot and the launch file works as expected, so the problem is in fact the OpenCR board. However, I do not know how to fix the problem. I already tried to update the firmware on the OpenCR, which did not help.

I also tried replacing the OpenCR by another board that was from a Turtlebot we did not yet assemble - but I was not lucky with this one either.

bastinat0r commented 1 year ago

I finally found the mistake: I used the wrong link when downloading the OpenCR firmware image for the turtlebot3, which leads exactly to this behavior. @Newmodel-YUKECHI maybe you can fix the problem by updating OpenCR with the latest ros2 firmware.

JeremyLebon commented 2 months ago

We had the same error. Our mistake was that we uploaded the firmware of the OpenCR 2 times. Once according to the 3.3 OpenCR setup (via RPI) and once according to the 3.4 OpenCR setup (with the Arduino IDE). Our solution was to do only the OpenCR setup with the RPI ( 3.3) and skip the step 3.4. Maybe it would be interesting to add this in the e-manual.