vsclab
turtlebot
ubuntu
ros
raspberry pi
ifconfig
$ sudo apt install net-tools
$ dpkg --list | grep ROS
若使用手機熱點,請將頻寬設定成 2.4 GHz
$ sudo vim /etc/netplan/50-cloud-init.yaml
$ sudo wpa_cli -i wlan0 list_networks
$ sudo wpa_cli -i wlan0 select_network network_id
/etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
addresses: [140.116.215.151/27]
gateway4: 140.116.215.157
nameservers:
addresses: [8.8.8.8]
wifis:
wlan0:
dhcp4: yes
dhcp6: yes
access-points:
"VSCLAB":
password: "VSCLAB-pwd"
wlan0:
dhcp4: yes
dhcp6: yes
access-points:
"rubato_phone":
password: "rubato_phone-pwd"
$ sudo netplan --debug apply # more details
# or
$ sudo netplan apply
# or (for ssh user)
$ sudo netplan try # apply only 120 sec then restore
$ ip a # IP address
$ ip r # default gateway IP address
$ ping -c 3 google.com
$ curl -I https://linuxhint.com/
每次裝置重新連線時,分享器會再重新分配 IP,導致 ROS IP 也要跟著重新設定 若希望固定 IP 位址,請參考以下教學
192.168.1.1
結論: SMPS (12V 5A) 與 Battery (11.1V) 不能同時供電!一次僅能使用一個電源輸入
Server 啟動 ros1 遇到 $shell 名稱錯誤問題
/tmp/host_sourcefile.txt:source:3: 沒有此一檔案或目錄: /opt/ros/noetic/setup./usr/bin/zsh
Solution:
重新定義/proc/$$/cmdline
PID執行緒參數
$ sudo netstat -ntlp
[sensor_msgs/BatteryState] 問題
[ERROR] [1642758400.659716]: Creation of publisher failed: Checksum does not match: 4ddae7f048e32fda22cac764685e3974,476f837fa6771f6e16e3bf4ef96f8770
Solution:
OpenCR 的版本必須與 PC 的 ROS 相同
如何在 PuTTY 對 tmux 視窗貼上 Solution: Press shift
Learn More →
由於 GPIO 原作者 Gordon 已不再維護,請使用
git clone https://github.com/WiringPi/WiringPi
Learn More →
raspi-config
$ git clone https://github.com/EmilGus/install_raspi-config
$ cd install_raspi-config
$ sudo sh install.sh
[Your firmware appears to be out of date (no start_x.elf). Please update] 問題 Solution: 树莓派通过raspi-config启动摄像头时,出错:Your firmwave appears to be out of date (no start_x.elf). Please update
$ df -h
$ sudo mount /dev/mmcblk0p1 /boot
$ sudo raspi-config
Learn More →
$ vcgencmd get_camera
> supported=1 detected=1 # success
$ ls /dev/video*
# raspistill
$ sudo apt install libraspberrypi-bin
$ raspistill -v
$ sudo modprobe bcm2835-v4l2
$ sudo raspistill -o test.jpg
# fswebcam
$ sudo apt-get install fswebcam
$ sudo fswebcam image.jpg
$ sudo fswebcam /dev/video10 image.jpg
raspicam
(TurtleBot)raspicam
Node