< >
Home » Turtlebot3中级教程_视频版 » Turtlebot3中级教程-制作用于终端烧录的OpenCR固件

Turtlebot3中级教程-制作用于终端烧录的OpenCR固件

文章说明

  • 本教程主要介绍如果在ubuntu系统下制作用于终端烧录的OpenCR固件
  • 测试环境:Ubuntu 22.04 + Arduino IDE 1.8.3 + TB3 Burger

操作步骤

$ ./tools/arduino-1.8.3/
  • 打开TB3的ROS1 Burger固件

82503153832b1eb8af2f3b6fdc9d3b87.gif

  • 然后去除turtlebot3_core_config.h文件下的#define NOETIC_SUPPORT 一句前面的注释符

647b6f52d3bbcdc1409bb80cfaf6f5e8.png

  • 另存为turtlebot3_core_test,且导出二进制文件

1b225d7c35b568d5a719f58392acff2e.gif

  • turtlebot3_core_test.ino.OpenCR.bin即为生成的二进制文件
$ ls ~/Arduino/turtlebot3_core_test/
turtlebot3_burger.h       turtlebot3_core_test.ino
turtlebot3_core_config.h  turtlebot3_core_test.ino.OpenCR.bin
  • 下载opencr_update.tar.bz2
$ cd
$ wget https://github.com/ROBOTIS-GIT/OpenCR-Binaries/raw/master/turtlebot3/ROS1/latest/opencr_update.tar.bz2 && tar -xvf opencr_update.tar.bz2 && cd ./opencr_update
  • 使用脚本制作固件
# 命令样式
$ opencr_ld_shell_x86 make [源二进制文件] [输出文件] [版本号]
# 示例
$ ./opencr_ld_shell_x86 make ~/Arduino/turtlebot3_core_test/turtlebot3_core_test.ino.OpenCR.bin Burger-noetic-test-firmware   test-v1.0
opencr_ld_shell ver 1.0.0
make firmware...
[  ] file name      : /home/ubuntu/Arduino/turtlebot3_core_test/turtlebot3_core_test.ino.OpenCR.bin 
[  ] file size      : 186768 bytes
[  ] fw_name        : Burger-noetic-test-firmware 
[  ] fw_ver         : test-v1.0 
[OK] finished       : 188056 bytes
# 查看是否生成了固件
$ ls Burger-noetic-test-firmware.opencr
Burger-noetic-test-firmware.opencr
  • 接上OpenCR板,烧录生成的测试固件
$ cd ~/opencr_update
$ ./update.sh /dev/ttyACM0 Burger-noetic-test-firmware.opencr
x86_64
amd64
OpenCR Update Start..
opencr_ld_shell ver 1.0.0
opencr_ld_main 
[  ] file name      : Burger-noetic-test-firmware.opencr 
[  ] file size      : 183 KB
[  ] fw_name        : Burger-noetic-test-firmware 
[  ] fw_ver         : test-v1.0 
[OK] Open port      : /dev/ttyACM0
[  ]
[  ] Board Name     : OpenCR R1.0
[  ] Board Ver      : 0x17020800
[  ] Board Rev      : 0x00000000
[OK] flash_erase    : 0.99s
[OK] flash_write    : 1.71s 
[OK] CRC Check      : 1298530 1298530 , 0.008000 sec
[OK] Download 
[OK] jump_to_fw 
  • 使用装有ROS1 Noetic的Burge来r上机测试
$ roslaunch turtlebot3_bringup turtlebot3_robot.launch
... logging to /home/ubuntu/.ros/log/5e2cc59a-0a9d-11ee-81ef-63b700e677d4/roslaunch-TB3BG-R12V301-5981.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://192.168.0.26:35895/

SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.13
 * /turtlebot3_core/baud: 115200
 * /turtlebot3_core/port: /dev/ttyACM0
 * /turtlebot3_core/tf_prefix:
 * /turtlebot3_lds/frame_id: base_scan

NODES
  /
    turtlebot3_core (rosserial_python/serial_node.py)
    turtlebot3_diagnostics (turtlebot3_bringup/turtlebot3_diagnostics)
    turtlebot3_lds (ld08_driver/ld08_driver)

auto-starting new master
process[master]: started with pid [5990]
ROS_MASTER_URI=http://192.168.0.26:11311

setting /run_id to 5e2cc59a-0a9d-11ee-81ef-63b700e677d4
process[rosout-1]: started with pid [6000]
started core service [/rosout]
process[turtlebot3_core-2]: started with pid [6007]
process[turtlebot3_lds-3]: started with pid [6008]
process[turtlebot3_diagnostics-4]: started with pid [6009]
/dev/ttyACM0    OpenCR Virtual ComPort in FS Mode
/dev/ttyUSB0    CP2102 USB to UART Bridge Controller
FOUND LiDAR_LD08 @port :/dev/ttyUSB0
[INFO] [1686738156.462989]: ROS Serial Python Node
[INFO] [1686738156.478358]: Connecting to /dev/ttyACM0 at 115200 baud
[INFO] [1686738158.592325]: Requesting topics...
[INFO] [1686738158.611087]: Note: publish buffer size is 1024 bytes
[INFO] [1686738158.615859]: Setup publisher on sensor_state [turtlebot3_msgs/SensorState]
[INFO] [1686738158.629011]: Setup publisher on firmware_version [turtlebot3_msgs/VersionInfo]
[INFO] [1686738158.696759]: Setup publisher on imu [sensor_msgs/Imu]
[INFO] [1686738158.713026]: Setup publisher on cmd_vel_rc100 [geometry_msgs/Twist]
[INFO] [1686738158.742220]: Setup publisher on odom [nav_msgs/Odometry]
[INFO] [1686738158.752468]: Setup publisher on joint_states [sensor_msgs/JointState]
[INFO] [1686738158.762695]: Setup publisher on battery_state [sensor_msgs/BatteryState]
[INFO] [1686738158.772757]: Setup publisher on magnetic_field [sensor_msgs/MagneticField]
[INFO] [1686738158.833393]: Setup publisher on /tf [tf/tfMessage]
[INFO] [1686738158.845870]: Note: subscribe buffer size is 1024 bytes
[INFO] [1686738158.850485]: Setup subscriber on cmd_vel [geometry_msgs/Twist]
[INFO] [1686738158.862573]: Setup subscriber on sound [turtlebot3_msgs/Sound]
[INFO] [1686738158.875611]: Setup subscriber on motor_power [std_msgs/Bool]
[INFO] [1686738158.888396]: Setup subscriber on reset [std_msgs/Empty]
[INFO] [1686738161.733457]: Setup TF on Odometry [odom]
[INFO] [1686738161.739598]: Setup TF on IMU [imu_link]
[INFO] [1686738161.745507]: Setup TF on MagneticField [mag_link]
[INFO] [1686738161.751494]: Setup TF on JointState [base_link]
[INFO] [1686738161.772239]: --------------------------
[INFO] [1686738161.778285]: Connected to OpenCR board!
[INFO] [1686738161.784152]: This core(v1.2.6) is compatible with TB3 Burger
[INFO] [1686738161.790143]: --------------------------
[INFO] [1686738161.796308]: Start Calibration of Gyro
[INFO] [1686738164.299725]: Calibration End
  • 启动正常,说明前面的对noetic的配置修改已经成功写入

备注

  • 本教程只是测试了在ubuntu下的操作,实际上在win下也能制作固件,具体样例参阅以下内容
## How to create a binary file that can be uploaded
### Windows
  - run cmd
  - ) > opencr_ld_shell_x86.exe make [SOURCE_BIN] [OUTPUT] [VERSION]
    - ex) > opencr_ld_shell_x86.exe make turtlebot3_core.ino.OpenCR.bin burger V190814
### Linux
  - run bash
  - $ opencr_ld_shell_x86 make [SOURCE_BIN] [OUTPUT] [VERSION]
  - or $ opencr_ld_shell_arm make [SOURCE_BIN] [OUTPUT] [VERSION]
    - ex) $ opencr_ld_shell_x86 make turtlebot3_core.ino.OpenCR.bin burger V190814

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: none