카테고리 없음2022. 7. 3. 21:38

(AI로봇랩 2기 2~6강) SLAM on ROS2

https://youtu.be/au4sbBUtdC0

 

오로카 cartographer 강연 20201201

https://youtu.be/GzZGl0kzGOM

 

Posted by orasman
카테고리 없음2022. 7. 2. 23:29

오로카 ROS2 강좌

https://cafe.naver.com/openrt/24070

 

Distribution 이란 ROS 패키지의 배포 버전 : http://wiki.ros.org/Distributions

 

최신 Distribution : ROS Noetic Ninjemys

타겟 플랫폼(REP-3) :  Ubuntu Focal Fossa (20.04)  (https://www.ros.org/reps/rep-0003.html)

ROS1 버전 확인법 : rosversion -d

 

ROS2 Distribution 정보 : https://docs.ros.org/en/galactic/Releases.html

Distribution : galactic ('22.11)

Support Platform : Ubuntu 20.04 (Focal)

ROS2 버전 확인 법 : echo $ROS_DISTRO    ==>  응답 : galactic

 

ROS 추천 패키지 : https://cafe.naver.com/openrt/25422

ROS Core < ROS Base < Desktop

rcl(ros client libraries) : rclc, rclcpp, rclpy

RMW(ROS MiddleWare)

ROS2 추천 패키지 : cartographer_ros

 

galactic 설명/설치

https://docs.ros.org/en/galactic/Releases/Release-Galactic-Geochelone.html

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Posted by orasman
카테고리 없음2022. 7. 2. 19:30

cyglidar 원래 버전

https://github.com/CygLiDAR-ROS/cyglidar_d1

 

cyglidar ROS2 버전?

https://github.com/madgrizzle/cyglidar_d1/tree/ROS2v0.1

 

ROS2 빌드 명령어 : colcon build

 

 

 

ROS2 cyglidar를 빌드하면 이런 에러가 난다

 

--- stderr: cyglidar_d1
CMake Error at CMakeLists.txt:16 (find_package):
  By not providing "Findcatkin.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "catkin", but
  CMake did not find one.

  Could not find a package configuration file provided by "catkin" with any
  of the following names:

    catkinConfig.cmake
    catkin-config.cmake

  Add the installation prefix of "catkin" to CMAKE_PREFIX_PATH or set
  "catkin_DIR" to a directory containing one of the above files.  If "catkin"
  provides a separate development package or SDK, be sure it has been
  installed.
  ---
  Failed   <<< cyglidar_d1
  
  Summary: 0 packages finished
     1 package failed: cyglidar_d1
     1 package had stderr output: cyglidar_d1

 

catkin_make는 ROS1 때 빌드 시스템

ROS2 빌드 시스템은 colcon build 임  (설명 : https://design.ros2.org/articles/build_tool.html)

 

 

동일한 에러에 대한 답변을 찾음

==> 이런 에러는  ROS1 용으로 만들어 진거라서 ROS2로 바꾸려면 많은걸 해야 한다고 함

 

That package has been created for ROS1, to run it on ROS2, you will have to rewrite it 
(change build system from catkin to colcon, rewrite specific files, etc.). 
If you are a beginner, this might be too much, 
so I suggest building & running it on ROS1 so you can learn how things work 
(or you can find other robot that runs ROS2).

 

https://answers.ros.org/question/385797/issue-with-creating-a-workspace-ros2/?sort=votes

 

동일한 에러인데, 답변 된게 없음

https://answers.ros.org/question/279226/problems-with-findpackage-in-cmake/

 

 

동일한 에러에 대해 catkin 을 설치해도 해결이 안됐다는 글

(괜히 catkin 설치했다가는 ros 전체를 지워야 하므로 하지 말것)

https://chowdera.com/2022/03/202203301603120599.html

 

 

ROS2 cyglidar 소스 수정 내용을 보면 아래와 같은 작업이 되어 있지 않음

ROS2: C++로 publisher와 subscriber 만들기     https://www.robotstory.co.kr/king/?vid=889

 

위와 같은 작업이 소스코드에 다 안되어 있는것 같다?

 

 

ROS 2 기초 - publisher  작성하기 (C++) https://m.blog.naver.com/junghs1040/222142391475

 

결론 : ROS2 버전으로 완성된게 다 만들어진게 아닌것 같다.

 

ROS2 package 만드는 설명

https://docs.ros.org/en/eloquent/Tutorials/Creating-Your-First-ROS2-Package.html

 

 

CMake가 아래 처럼 ament_cmake 빌드툴을 써야 ROS2 버전으로 컴파일 됨

<?xml version="1.0"?>
<?xml-model
   href="http://download.ros.org/schema/package_format3.xsd"
   schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
 <name>my_package</name>
 <version>0.0.0</version>
 <description>TODO: Package description</description>
 <maintainer email="user@todo.todo">user</maintainer>
 <license>TODO: License declaration</license>

 <buildtool_depend>ament_cmake</buildtool_depend>

 <test_depend>ament_lint_auto</test_depend>
 <test_depend>ament_lint_common</test_depend>

 <export>
   <build_type>ament_cmake</build_type>
 </export>
</package>

 

 

혹시나 colcon 빌드 시스템이 정상인지 확인하기 위해

여기에 나오는 hello world 기본 package 튜토리얼을 따라 해보니 정상 빌드 된다.

 

Creating your first ROS 2 package  https://docs.ros.org/en/eloquent/Tutorials/Creating-Your-First-ROS2-Package.html

 

Bridge communication between ROS 1 and ROS 2

https://github.com/ros2/ros1_bridge/blob/master/README.md

The ROS 1 bridge can connect topics from ROS 1 to ROS 2 and vice-versa. See the dedicated documentation on how to build and use the ROS 1 bridge.

from :

https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html

A) raspberry-pi setup

1) install Ubuntu 16.04 Xeniel & ROS1 Kinetic (using Ubiquityrobotics ubuntu image)

2) build cyglidar

3) configure ROS_MASTER_URI=192.168.0.39:11311 as raspberrypi ip addr

 

B) laptop setup

1) install Ubuntu 20.04 focal into laptop

2) install ROS1 noetic

3) install ROS2 galactic

4) build https://github.com/ros2/ros1_bridge

5) run ROS1 to ROS2 (apply ROS_MASTER_URI=192.168.0.39:11311, rapberrypi ip addr)

6) 'rostopic list' can show received topic from cyglidar at raspberrypi

7) run rviz to display scan_2D topic

8) there is a error such as 'fail to connect.. ubiquityrobotics'

 

 

 

 

 

 

 

 

Posted by orasman
카테고리 없음2022. 6. 26. 21:51

edu.irobot.com 싸이트 상단에 Learning Library 클릭 : 로봇 종류에 CREATE3 선택

https://edu.irobot.com/learning-library?robotValue=Advanced%20Create%203%20Robot&toggle=lessons 

 

라즈베리파이 연결 방법 

https://edu.irobot.com/learning-library/connect-create-3-to-raspberry-pi

라즈베리파이 연결 설명서

https://iroboteducation.github.io/create3_docs/setup/pi4/

 

우분투 서버 이미지를 다운받고 SD메모리 카드에 옮긴다

우분투 20.04 "서버" 버전을 설치하라고 씌여 있는데 "데스크톱"버전을 설치했다가 이틀을 날려 먹었다.

데스크톱은 윈도우OS 처럼 GUI와 각종 기본 프로그램 깔려 있어서 무겁고 느리다.

!! 역시 문장 하나하나 자세히 읽고 넘어가야 한다. 특히 영어라면 해석이 귀찮아도 잘 읽자 !!

!!!! 우분투 다운로드 링크로 가면 22.04 최신 버전이 올라와 있다

이걸 간과하고 그냥 다운로드하면 아래와 같이 개고생한다.

20.04 버전은 공식홈페이지에 안나온다. 아래 링크에서 꼭 20.04 서버 버전을 받아야 한다 

https://pimylifeup.com/ubuntu-server-raspberry-pi/

 

라즈베리파이에 SD 메모리 CARD를 꼽기전에 아래 STEP4까지 작업을 먼저해야 한다.

 

STEP2에 보면 system-boot partition 이라는 곳에 usercfg.txt를 수정하라는데

이 파티션은 윈도우 OS에서는 보이지 않는다. (이걸 몰라서 하루 날려 먹음)

리눅스나 우분투가 설치된 노트북에 SDCARD를 연결해야, system-boot partition 보인다.

파일명은 usercfg.txt가 아니고 그냥 config.txt 를 수정하면 된다.

 

STEP3. cmdline.txt 에 rootwait 라는 명령어 뒤에 modules-load=dwc2,g_ether 를 추가한다

 

STEP4. system-boot partition에 있는 network-config 에 아래 내용을 추가한다.

usb0:
   dhcp4: false
   optional: true
   addresses: [192.168.186.3/24]

 

이 명령어는 라즈베리파이 USB-C 포트에 이더넷 주소를 할당하는 것.

CREATE3 로봇의 USB-C 포트는 생산할때 부터 192.168.186.2 로 설정되어 있음.

 

나처럼 network-config를 수정하기전에 SDCARD를 라즈베리파이에 꼽았다면 시스템에 적용이 안된다.

라즈베리파이에서 로그인 하고 아래 파일을 직접 수정해야 한다.

/etc/netplan/50-cloud-init.yaml

 

그리고 연결할 무선 wifi 정보를 입력해준다.

그래야 패키지 파일들을 인터넷으로 받아서 설치가 가능하다.

첫 부팅 전이라면 network-config를 수정하면 될것 같고, 한번 부팅을 했다면 netplan 폴더에 있는 yaml 파일을 수정

https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#4-boot-ubuntu-server

sudo nano /etc/netplan/50-cloud-init.yaml

wifis:
  wlan0:
    dhcp4: true
    optional: true
    access-points:
      "home network":
        password: "123456789"

라즈베리파이에 모니터, 키보드, 마우스를 연결하고 SDCARD를 꼽고 처음 부팅하면

로그인 아이디를 물어본다. 당황하지 말고 아이디 ubuntu, 비번 ubuntu를 넣는다.

 

!중요!

부팅하고 로그인 화면이 나와도 조금 기다렸다가 입력하자.

첫 부팅시 로그인 관련 무슨 파일을 만드는데 시간이 걸린다고 한다!

 

그러면 새로운 비번을 만들라는 안내가 나오므로 비번을 수정한다.

 

로그인이 되면 아래 명령을 토씨하나 틀리지 말고 입력한다.

 

sudo apt update
sudo apt install locales 
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

sudo apt update && sudo apt install -y curl gnupg2 lsb-release build-essential git cmake

sudo curl -ksSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key  -o /usr/share/keyrings/ros-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

sudo apt update && sudo apt install -y ros-galactic-ros-base python3-colcon-common-extensions python3-rosdep ros-galactic-rmw-fastrtps-cpp ros-galactic-rmw-cyclonedds-cpp ros-galactic-irobot-create-msgs

echo "source /usr/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrc
echo "export _colcon_cd_root=/opt/ros/galactic/" >> ~/.bashrc
echo "source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash" >> ~/.bashrc
echo "source /opt/ros/galactic/setup.bash" >> ~/.bashrc

echo "export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> ~/.bashrc
   또는
echo "export RMW_IMPLEMENTATION=rmw_fastrtps_cpp" >> ~/.bashrc


reboot

 

혹시 key 관련 에러가 난다면

/usr/share/keyrings/ros-archive-keyring.gpg 파일이 있는지 확인하고

 

"E: Unable to locate package ros-galactic-ros-base" 와 같은 에러가 난다면??

 

구글 검색하다보니 ROS2 설치 싸이트를 찾게 되었다.

https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html

 

ros관련 패키지 설치가 안되면 위 명령중 제대로 안된게 있다는 뜻이므로,

/etc/apt/sources.list.d/ros2.list 파일도 있는지 확인할 것 (해당 파일 열어서 내용도 확인)

 

이건 ros 설치이후 입력하는 명령이라..

~/.bashrc 들어가서 입력한 내용에 틀린 부분이 없는지 볼 것

 

맨 마지막에 rmw_cyclonedds_cpp 또는 rmw_fastrtps_cpp중 하나를 선택해서 입력한다

 

! 초보자를 위한 개발 가이드!

새벽까지 했는데도 잘 해결이 안된다면 발닦고 자라.

더 붙들고 있어야 해결도 안되고 몸만 망가진다 - 단, 급하면 하루 이틀만 밤새자!

자고 일어나면 새로운 방법이 떠오른다.

구글 검색과 시간이 약이다.

 

root 비밀번호 설정 방법

https://linuxconfig.org/how-to-set-a-root-password-on-ubuntu-22-04-jammy-jellyfish-linux

$ sudo passwd
[sudo] password for linuxconfig: 
New password: 
Retype new password: 
passwd: password updated successfully

 

 

 

STEP5. 로봇 뚜껑을 열고 USB/BLE (블루투스) 선택 스위치를 USB로 하고

USB-C to USB-C 케이블로 CREATE3와 라즈베리파이를 연결한다.

https://iroboteducation.github.io/create3_docs/hw/adapter/

 

별걸 다 했지만 원인은 22.04 Jammy 버전을 설치했던게 문제

20.04 focal을 설치해야 한다.

 

universe 도 설치해 보고 (실패)

https://askubuntu.com/questions/1244865/ros-download-unable-to-locate-package-error

 

ROS2 설치도 해보고 (실패)

https://hybridego.net/entry/ROS2-apt-update-key-%EB%AC%B8%EC%A0%9C

 

ros-latest 업데이트도 해보고 (실패)

https://stackoverflow.com/questions/69277078/problem-with-instalation-ros-2-e-unable-to-locate-package-ros-foxy-desktop

 

https://ubuntu.com/download/alternative-downloads

 

ROS2 문서를 보니 20.04버전 Focal 만 설치 된다고 함

https://docs.ros.org/en/galactic/Installation.html

 

우분투 서버 버전별 이름

https://ubuntu.com/server

 

여기서 20.04 on raspberrypi 다운로드 가능

https://pimylifeup.com/ubuntu-server-raspberry-pi/

 

20.04 설치 과정 설명

https://linuxhint.com/install-ubuntu-desktop-20-04-lts-on-raspberry-pi-4/

 

wifi 설정

https://huobur.medium.com/how-to-setup-wifi-on-raspberry-pi-4-with-ubuntu-20-04-lts-64-bit-arm-server-ceb02303e49b

https://websetnet.net/ko/how-to-connect-to-wifi-from-the-terminal-in-ubuntu-linux/

 

YAML은 들여쓰기를 잘해야 한다

https://velog.io/@jnine/YAML%EC%9D%B4%EB%9E%80

 

 

 

와이파이가 안켜질때

https://askubuntu.com/questions/1291424/failed-to-start-netplan-wpa-wlan0-sevice-unit-netplan-wpa-wlan0-service-not-fou

 

putty 터미널 접속

https://toentoi.tistory.com/53

 

apt update 에러날때

https://enant.tistory.com/18

 

sudo killall apt apt-get
  - 진행중인 프로세스가 없다라고 뜨면, 아래와 같이 하나하나씩 디렉토리를 삭제해주세요.
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock*
sudo dpkg --configure -a 
sudo apt update

 

드디어 라즈베리파이4에 ROS 깔고, CREATE3와 USB로 연결 성공

하지만 CREATE3에서 나와야 하는 토픽이 보이지 않는다

CREATE3인 192.168.186.2 는 ping으로 살아 있음을 확인함

라즈베리파이 보드는 192.168.186.3

 

CREATE3의 ROS는 상시동작인가? 아니면 시작하는 방법이 있는가??

setup 유튜브가 있었네... 따라하니까 토픽 나온다

https://edu.irobot.com/learning-library/create-3-getting-started

https://iroboteducation.github.io/create3_docs/api/docking/

 

Docking - Create® 3 Docs

Create® 3 Docking The Create® 3 robot is equipped with a docking station to recharge it between experiments. Through the ROS 2 APIs users can command docking and undocking autonomous behaviors. Note that, in order for the robot to detect the dock, determ

iroboteducation.github.io

 

http://192.168.0.58/home

CREATE3에 CONNECT 메뉴에서 와이파이를 지정해 주면 로봇에 직접 접속(192.168.0.10)하지 않고 IP로 접속 가능.

 

Undock 액션명령은 동작을 안하네.. 이건 왜 그럴까?

 

https://iroboteducation.github.io/create3_docs/api/docking/

 

ros2 action list -t

해보니 /cygbot/dock 이렇게 응답이 나온다

 

이걸보니 /dock 명령이 아니라 /cygbot/dock 으로 보내야 할것 같다.

 

ros2 action send_goal /cygbot/dock irobot_create_msgs/action/DockServo "{}"

 

 

 

다시해보니 이런 에러가 난다.

tev: ddsi_udp_conn_write failed to udp/192.168.0.58:35455 failed with retcode -1

 

https://answers.ros.org/question/390859/ddsi_udp_conn_write-failed/

 

갑자기 wifi가 끊어진다 

sudo iw wlan0 set power_save off

https://forum.clockworkpi.com/t/how-to-disable-wifi-power-save-to-prevent-disconnects/933

 

ip addr    <== 이 명령으로 ip할당 여부 확인

/etc/init.d/networking restart   <== 이 명령으로 wlan0 ip 가 생긴다

  

ls /sys/class/net
ip addr
/etc/init.d/networking restart
sudo apt install ifupdown
sudo ifup eth0
sudo vi /etc/network/interfaces
sudo systemctl stop NetworkManager.service
sudo systemctl disable NetworkManager.service
iw wlan0 set power_save off
iw wlan0 get power_save
-->Power save: on
/sbin/iwconfig wlan0 power off

 

 

connect: Network is unreachable

https://m.blog.naver.com/action1020/220087014790

https://forum.clockworkpi.com/t/how-to-disable-wifi-power-save-to-prevent-disconnects/933

 

Make "iw wlan0 set power_save off" permanent

https://raspberrypi.stackexchange.com/questions/96606/make-iw-wlan0-set-power-save-off-permanent

 

ddsi_udp_conn_write failed

https://answers.ros.org/question/390859/ddsi_udp_conn_write-failed/

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Posted by orasman
카테고리 없음2021. 5. 22. 00:32

<키워드>

#ROS #RViZ #CygLidar #시그라이다 #PointCloud #원격데이터표시

 

<요약>

roslaunch로 rviz가 실행될때 MASTER_URI 포트번호가 랜덤하게 바뀌는 문제가 있어서 실패했지만..

RViZ를 수동으로 실행해서 /scan_2D, /scan_3D 토픽을 Add해주고 Fixed Frame 이름을 laser_link로 해주면

노트북에서 라즈베리파이에 연결된 라이다가 스캔한 데이터를 원격으로 표시할 수 있다.

 

<내용>

ROS의 장점이 노드간 XMLRPC 방식으로 메시지 통신을 하기 때문에

노드가 어디에 있던지 인터넷 연결만 되어 있으면 통신이 가능하다는 점이다.

라즈베리파이에 CygLidar를 연결하고 RViZ로 스캔 데이터를 표시 할 수 있지만,

노트북에서도 RViZ를 실행시켜 스캔데이터를 표시 할 수 있다.

 

roscore는 라즈베리파이 또는 노트북중에 한 군데에서 실행해야 한다.

그리고 roscore를 실행하는 장치의 IP주소를 ROS_HOSTNAME, ROS_MASTER_URI 에 적어줘야 한다.

 

그리고 터미널 창을 띄울때 마다 ROS_HOSTNAME을 매번 설정해 줘야 하는데,

이게 귀찮으니 ~/.bashrc에 적어두면 터미널 창이 열릴때 마다 자동으로 실행되서 ROS_HOSTNAME이 설정된다

 

일단 roscore를 라즈베리파이에서 실행했다.

 

Raspberry pi에서 bashrc를 수정한다.

nano ~/.bashrc

$ROS_HOSTNAME = 192.168.0.28

$ROS_MASTER_URI = http://192.168.0.28:11311

 

Notebook에서도 동일하게 bashrc를 수정한다.

nano ~/.bashrc

$ROS_HOSTNAME = 192.168.0.28

$ROS_MASTER_URI = http://192.168.0.28:11311

 

라즈베리파이에 라이다를 연결하고 roscore와 cyglidar_d1 패키지를 실행한다

$roscore  실행하고, 새로운 터미널 창을 열고

$roslaunch cyglidar_d1 cyglidar.launch 실행

 

그리고 노트북에서 rosnode 명령어로 현재 실행중인 node를 조회해 본다.

$rosnode list

/line_laser

 

라즈베리파이와 노트북이 같은 네트워크 내에 있다면 위와 같이 /line_laser가 보인다

 

노드의 자세한 정보를 알고 싶다면..

 

$rosnode info /line_laser

----------------------------------------------------------

Node [/line_laser]
Publications: 
 * /rosout [rosgraph_msgs/Log]
 * /scan_2D [sensor_msgs/PointCloud2]
 * /scan_3D [sensor_msgs/PointCloud2]

Subscriptions: None

Services: 
 * /line_laser/get_loggers
 * /line_laser/set_logger_level


contacting node http://192.168.0.28:41707/ ...
Pid: 2827
Connections:
 * topic: /rosout
    * to: /rosout
    * direction: outbound
    * transport: TCPROS

 

 

노트북에서 토픽 목록을 조회해 보면 /scan_2D, /scan_3D 모두 볼 수 있다.

$rostopic list

/rosout
/rosout_agg
/scan_2D
/scan_3D

 

토픽 내용을 표시해 보면 라즈베리파이로 부터 잘 전송되서 표시된다.

$rostopic echo /scan_2D

0,0,0,0,0.....

 

노트북에서 cyglidar.launch 파일 내용중에 cyglidar 노드를 실행하는 부분을 지우고

rviz를 실행하는 부분만 남겨 놓고 roslaunch로 실행하면.. 에러가 난다.

 

$roslaunch cyglidar_d1 cyglidar_rviz_only.launch

Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Unable to contact my own server at [http://192.168.0.28:39557/].
This usually means that the network is not configured properly.

A common cause is that the machine cannot connect to itself.  Please check
for errors by running:

ping 192.168.0.28
For more tips, please see
http://www.ros.org/wiki/ROS/NetworkSetup
The traceback for the exception was written to the log file

 

Unable to contact my own server at [http://192.168.0.28:39557/].

이런 에러가 나는데, roslaunch 를 실행할 때 마다 포트번호가 랜덤하게 바뀐다.

분명히 ROS_MASTER_URI = http://192.168.0.28:11311 이라고 적어 줬는데.

포트번호를 11311 이라고 써줬는데!! roslaunch로 rviz를 실행하면 포트번호가 엉뚱하게 뜨면서 에러가 난다!!!

 

구글링을 열심히 해보고 ROS_IP도 설정하고, 뭐.. 몇가지 시도를 해봤지만..

ROS_MASTER_URI의 포트번호가 랜덤하게 바뀌면서 MASTER에 접속이 안되는 문제 해결은 못했다!!!ㅠㅠ

 

노트북에서 node ping 명령으로 /line_laser를 조사해 보면 정상으로 동작함을 알 수 있다.

 

$rosnode ping /line_laser

rosnode: node is [/line_laser]
pinging /line_laser with a timeout of 3.0s
xmlrpc reply from http://192.168.0.28:41707/ time=17.902851ms
xmlrpc reply from http://192.168.0.28:41707/ time=8.000135ms

 

 

그래서 roslaunch 로 rviz를 실행하지 않고, 직접 rviz를 실행시켜서 /scan_2D 토픽을 찾아 표시해 보기로 했다.

 

$rviz

rviz 실행하고 Add 버튼 눌러서 /scan_2D 토픽을 추가했더니 에러가 난다.

아래 그림처럼 Fixed Frame [map] does not exist 라는 에러임

 

 

rviz에서 Fixed Frame 이름을 직접 laser_link라고 입력해 줬더니.. 짠! 하고 스캔된 데이터가 표시됐다!!! ㅋㅋ

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Posted by orasman
카테고리 없음2021. 5. 16. 08:27

CygLiDAR 사용기를 정리하는 중...

 

<요약>

>>라즈베리파이 2 시리즈는 조금 느리다 (비추)

>>라즈베리파이 3B에 ROS가 미리 설치된 우분투 이미지를 설치한다

          https://downloads.ubiquityrobotics.com/pi.html

>>라이다 제조사 깃허브에서 ROS package를 내려받는다 (git clone -b v0.0.3 옵션 사용)

         git clone -b v0.0.3 https://github.com/CygLiDAR-ROS/cyglidar_d1.git

>>RViZ에 point cloud가 표시되지 않는다면 USB2Serial 장치를 활성화 한다

         https://belitino.tistory.com/140

>>roslaunch로 라이다 패키지를 실행하면 RViZ로 센서 데이터를 볼 수 있다

 

 

<작업 후기>

 

장난감 RC카에 라이다 붙여서 자율주행이 목표라서

일단 라즈베리파이를 써야 겠다는 생각이 들었다.

 

집에 있던 '라즈베리파이2 B+'에 ROS를 깔기로 했다..

일단 최신 라즈비안을 깔았는데.. 너무 느리다..

라즈베리파이가 너무 구형이라 느린가?

 

당근 마켓에서 '라즈베리파이3 B'를 3만원에 샀다.

 

인터넷을 찾아보니 ROS는 우분투에만 깔린다고 한다 (이걸 찾은게 삽질의 시작..ㅠ)

이 말 때문에 라즈비안은 데비안 버전이라서 ROS 설치가 안되는 줄 알았다..

우분투 16.04만 동작한데서 설치 했는데.. 너무 느리다..!! 아아아악!

18.04같은 다른 버전도 이것저것 깔았는데 부팅하다 멈추거나 너무 느리다.

데스크톱 버전이라 느린가 싶어서 서버 버전(텍스트만 나옴)을 깔고 X-window GUI를 설치시도,

서버 버전은 무선랜도 안잡혀서 구글링해서 인터넷 잡고 GUI를 깔았는데.. 결국 GUI 로딩에 실패!

armhf(hard float) 32bit 버전이 가볍다고 깔았는데.. 역시 안되고..ㅠ

더보기

ROS 는 ubuntu에 깔린다고 함

 

Install ROS Kinetic on Raspberry Pi 3 <Ubuntu MATE 16.04.2.>

https://www.instructables.com/How-to-Install-ROS-Kinetic-on-Raspberry-Pi-3/

 

Install ROS Melodic on Raspberry Pi 3 <Ubuntu MATE 18.04.>

https://roboticsbackend.com/install-ros-on-raspberry-pi-3/

Raspbian, which is itself created from Debian.

Unfortunately ROS is not supported on Debian.

 

 

라즈비안 데비안 2021-03-04-raspios-buster-armhf-full.img 14GB class10 SD메모리에 설치

  --한글폰트명령 : sudo apt-get install fonts-unfonts-core

 

ubuntu-mate-20.04.1-desktop-arm64+raspi.img 설치됨 5/16오후 8G메모리카드.

ubuntu-mate-20.10-desktop-armhf+raspi.img 32bit임 설치됨.느림. 5/16아침. SD메모리가 Aview 16GB에설치

 

ubuntu-mate-20.04.1-desktop-armhf+raspi.img.xz 부팀멈춤. SD메모리 8GB여서 그런가?

ubuntu-18.04.5-preinstalled-server-arm64+raspi3.img 서버버전(Text only). GUI설치 후 부팅멈춤. 

    데스크탑 버전은 GUI가 설치된 버전, 서버 버전은 텍스트 기반 저용량

    ubuntu 18.04 서버 버전에 GUI설치 방법 : https://changun516.tistory.com/75

ubuntu-mate-20.04.1-desktop-arm64+raspi.img.xz 느리게 동작함. SD메모리 8GB여서 그런가?

 

 

https://vanilet.tistory.com/16 

Ubuntu 18.04 설치후 유선랜, 무선랜 다 안될때

/etc/netplan/50-.....yaml  파일을 편집하면 된다

중요한건 들여쓰기를 꼭 지켜야 하는데, 탭 으로 들여쓰지 말고 4칸씩 들여써야 인식된다!!

 

계속 화면이 꺼져서 OS 이미지를 다시 설치함..ㅠ ==> 원인은 HDMI to VGA 컨버터 불량 의심 (뜨거워짐)

 

라즈베리파이 버전에 따라 설치가능한 우분투 버전부터 체크했어야 함

https://ubuntu-mate.org/raspberry-pi/compatibility/

 

armhf (ARM hard Float)가 좀더 가벼움

 

 

 

다시 인터넷을 찾아보니 라즈비안(데비안)에도 ROS가 깔린다고 한다..(왜 이걸 이제서야 봤을까..ㅠ)

더보기

http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Kinetic%20on%20the%20Raspberry%20Pi

 

라즈비안(데비안)에 ROS 설치하는 방법이 있었음.. 우분투에 설치하려고 하다가 시간허비..ㅠ

게다가 이미 ROS까지 설치된 이미지도 있다고 한다!!

An SD Card Image with Ubuntu 16.04 (LXDE) and ROS Kinetic installed can be downloaded here for the Raspberry Pi 3  

 

 

자세히 읽어보니 ROS가 이미 설치된 우분투 이미지도 있었다!! (역시.. 매뉴얼을 정독을 해야 한다..ㅠ)

 

ROS 깔린 이미지로 라즈베리파이에 한방에 설치하는 방법

https://downloads.ubiquityrobotics.com/pi.html

여기에 ROS까지 설치된 우분투 이미지(16.04 Xenial LXDE)가 있음..

>> 2020-02-10 버전 설치함 (202-11-07 버전은 부팅하다 멈춤)

 

ROS, RViZ까지 미리 깔려 있어서 이미지만 SD메모리 카드로 굽기만 하면 됨!!

라즈베리파이에서 turtlesim도 잘 동작하고 RViZ 실행도 잘된다

 

자.. 이제.. CygLidar 깃허브에서 ROS용 Cyglidar패키지를 다운받는다

클론 위치를 ~/catkin_ws/src 로 하면 캐킷 빌드로 자동 포함되서 빌드된다.

git clone https://github.com/CygLiDAR-ROS/cyglidar_d1.git

 

아.. 그런데.. catkin_make하면 에러가 나다가 라즈베리파이가 멈춘다..

여러번 해도 동일 증상..ㅠ

라즈베리파이가 멈춰서 스크린샷 프로그램도 동작이 안되서..카메라로 찍어봤다..

 

에러 찾기 귀찮다..

라즈베리파이나 리눅스 버전이 문제인가 싶어서.. 무작정 노트북에 ROS 설치해서 다시 해본다..

 

USB메모리 카드에 우분투 이미지를 올리고 USB로 부팅해서 use Ubuntu without install 메뉴로 사용했는데..

이렇게 인스톨 없이 USB로 사용하는 리눅스는 재부팅하면 설치한 파일이 모두 초기화되서 사라진다..

결국 하드에 있던 파일들을 정리해서 파티션을 분할하고 윈도우/우분투 멀티부팅을 만들었다..

 

Ubuntu 16.04.07 desktop amd64 버전에 ROS kinetic을 설치하고 CygLidar_d1을 clone해서 catkin_make하면..

 

아.. 그래도.. 에러가 난다..

더보기

/home/orasman/catkin_ws/src/cyglidar_d1/src/cyglidar_pcl.cpp:32:41: warning: ‘MSB_BUFFER’ defined but not used [-Wunused-variable]
 static boost::array<char, HEX_SIZE_TWO> MSB_BUFFER, LSB_BUFFER;
                                         ^
/home/orasman/catkin_ws/src/cyglidar_d1/src/cyglidar_pcl.cpp:32:53: warning: ‘LSB_BUFFER’ defined but not used [-Wunused-variable]
 static boost::array<char, HEX_SIZE_TWO> MSB_BUFFER, LSB_BUFFER;
                                                     ^
cyglidar_d1/CMakeFiles/cyglidar_pcl_publisher.dir/build.make:86: recipe for target 'cyglidar_d1/CMakeFiles/cyglidar_pcl_publisher.dir/src/cyglidar_pcl.cpp.o' failed
make[2]: *** [cyglidar_d1/CMakeFiles/cyglidar_pcl_publisher.dir/src/cyglidar_pcl.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/orasman/catkin_ws/src/cyglidar_d1/src/cyglidar_pcl_publisher.cpp: In function ‘uint8_t cloudScatter_2D()’:
/home/orasman/catkin_ws/src/cyglidar_d1/src/cyglidar_pcl_publisher.cpp:183:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
/home/orasman/catkin_ws/src/cyglidar_d1/src/cyglidar_pcl_publisher.cpp: In function ‘uint8_t cloudScatter_3D()’:
/home/orasman/catkin_ws/src/cyglidar_d1/src/cyglidar_pcl_publisher.cpp:278:92: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
                     scan_3D.get()->points[index_3D].rgb = *reinterpret_cast<float*>(&rgb_3D);
                                                                                            ^
/home/orasman/catkin_ws/src/cyglidar_d1/src/cyglidar_pcl_publisher.cpp:289:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
/home/orasman/catkin_ws/src/cyglidar_d1/src/cyglidar_pcl_publisher.cpp: In function ‘void running()’:
/home/orasman/catkin_ws/src/cyglidar_d1/src/cyglidar_pcl_publisher.cpp:365:15: error: ‘class cyglidar_pcl_driver::cyglidar_pcl’ has no member named ‘packet_run’
         laser.packet_run(VERSION_NUM);
               ^
/home/orasman/catkin_ws/src/cyglidar_d1/src/cyglidar_pcl_publisher.cpp:367:15: error: ‘class cyglidar_pcl_driver::cyglidar_pcl’ has no member named ‘packet_frequency’
         laser.packet_frequency(FREQUENCY_LEVEL);
               ^
/home/orasman/catkin_ws/src/cyglidar_d1/src/cyglidar_pcl_publisher.cpp:369:15: error: ‘class cyglidar_pcl_driver::cyglidar_pcl’ has no member named ‘packet_pulse’
         laser.packet_pulse(VERSION_NUM, PULSE_CONTROL, PULSE_DURATION);
               ^
/home/orasman/catkin_ws/src/cyglidar_d1/src/cyglidar_pcl_publisher.cpp:359:9: warning: unused variable ‘sizePos’ [-Wunused-variable]
  size_t sizePos = 2;
         ^
cyglidar_d1/CMakeFiles/cyglidar_pcl_publisher.dir/build.make:62: recipe for target 'cyglidar_d1/CMakeFiles/cyglidar_pcl_publisher.dir/src/cyglidar_pcl_publisher.cpp.o' failed
make[2]: *** [cyglidar_d1/CMakeFiles/cyglidar_pcl_publisher.dir/src/cyglidar_pcl_publisher.cpp.o] Error 1
CMakeFiles/Makefile2:668: recipe for target 'cyglidar_d1/CMakeFiles/cyglidar_pcl_publisher.dir/all' failed
make[1]: *** [cyglidar_d1/CMakeFiles/cyglidar_pcl_publisher.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed
orasman@orasman-A515-K-AFLUL:~/catkin_ws$ 

 

 

에러 원인을 찾아봐야 겠다...

cyglidar_pcl_publisher.cpp : error : 'class cyglidar_pcl_driver::cyglidar_pcl' has no member name 'packet_run'

    laser.packet_run(VERSION_NUM)

 

CygLiDAR 제조사에 문의해서 찾은 원인은 깃허브에 올린 파일이 헤더파일과 소스파일 버전이 달라서 그럴수 있다고 함.

 

버전을 맞추니 정상적으로 컴파일 됨!(무야호~!)

git clone -b v0.0.3 https://github.com/CygLiDAR-ROS/cyglidar_d1.git

 

라이다를 붙여서 런치 실행 했는데 RViZ에 아무것도 안나옴..ㅠㅠ

토픽 리스트를 보니 퍼블리쉬 하는데? 왜 안나오지?

$ rostopic list
/clicked_point
/initialpose
/move_base_simple/goal
/rosout
/rosout_agg
/scan_2D
/scan_3D
/tf
/tf_static

 

리스트에는 나오지만, 토픽 메시지를 보니 내용이 없었다.

$ rostopic echo /scan_2D

 

노트북과 CygLiDAR를 연결해주는 USB컨버터가 동작을 안하나보다!

 

CygLiDAR 제조사 홈페이지에 보니 PL2303칩을 쓰고 있었다..

https://www.cygbot.com/downloads

 

http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=225&pcid=41 

 

Products

PL2303 Windows Driver Download   USB to UART RS232 Serial Windows Driver Installer Setup Program  (For PL2303 HXD, SA, TA, TB, RA GC, GS, GT, GL, GE , GD, GR versions) Installer version & Build date: 2.0.6 (2021-05-13) Windows Vista/7/8.1/10 (32 & 64-bi

www.prolific.com.tw

 

prolific 홈페이지에 가봐도 리눅스용 드라이버가 없다.. 리눅스용 드라이버 설치 방법을 찾았다..

https://belitino.tistory.com/140

 

$lsbus

Bus 002 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

 

$sudo modprobe usbserial vendor=0x067b product=0x2303

 

$dmesg

[  330.010769] usb 2-1.2: new full-speed USB device number 4 using ehci-pci
[  330.120607] usb 2-1.2: New USB device found, idVendor=067b, idProduct=2303
[  330.120615] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  330.120620] usb 2-1.2: Product: USB-Serial Controller D
[  330.120623] usb 2-1.2: Manufacturer: Prolific Technology Inc. 
[  331.155965] usbcore: registered new interface driver usbserial_generic
[  331.155980] usbserial: USB Serial support registered for generic
[  331.159009] usbcore: registered new interface driver pl2303
[  331.159028] usbserial: USB Serial support registered for pl2303
[  331.159055] pl2303 2-1.2:1.0: pl2303 converter detected
[  331.160791] usb 2-1.2: pl2303 converter now attached to ttyUSB0

 

PL2303 드라이버가 ttyUSB0에 붙었다고 메시지가 나왔다..

 

scan_2D 토픽을 보니 센싱한 값을 뿌리고 있다!

 

rviz에도 정상적으로 나온다!!

참고로 USB드라이버가 정상 동작하면 라이다 뒷쪽에 초록색 LED가 켜진다~

한참 헤맸지만 드디어 리눅스에 시그라이다를 연결했다~ ^^

 

다시 라즈베리파이로 돌아가서 시그라이다를 연결해 보자..

라즈베리에 설치한 우분투에서 clone -b v0.0.3 옵션으로 시그라이다 ROS 코드 다운로드 받아서 컴파일 했더니 아래 같은 에러발생

 

다시한번 제조사에 문의했더니 RAM부족이 원인인듯 하다고 하여 swap메모리를 설정해 보라고 함.

 

swap메모리 확보 방법

https://changun516.tistory.com/m/105

 

참고)

warning : Clock skew detected. Your build may be incomplete

catkin_make 중에 이런 에러가 나오면 NTP 재설정

 

$ sudo ntpdate -s time.bora.net

https://knoow.tistory.com/m/134

 

warnning이 몇개 있지만 라즈베리파이에서도 정상 컴파일 됐다

 

시그라이다 연결 USB 케이블을 라즈베리파이에 꼽았다.

노트북에서 했듯이 PL2303 드라이버가 동작하는지 확인해 봤다.

$dmesg

PL2302 serial to USB converter가 ttyUSB0에 연결됐다고 나온다

 

roslaunch로 실행했더니 RViZ가 실행되면서 point clowd가 정상적으로 보인다.

 

드디어 라즈베리파이에서 ROS 기반으로 시그라이다 토픽을 받을 준비가 됐다.

이제 RC카 제어코드와 주행로직 개발에 들어갈 준비가 됐다!

 

 

Posted by orasman
카테고리 없음2019. 7. 10. 23:27

https://quasarzone.co.kr/bbs/board.php?bo_table=qf_mobile&wr_id=12838

 

Posted by orasman
카테고리 없음2019. 7. 7. 21:06

 

 

2015 교육개정 - 수학

https://madebyan.tistory.com/60

Posted by orasman
카테고리 없음2019. 7. 1. 00:06

[오전] 하안도서관

 

11:49:30 정도에 조회 버튼 누를것

접속에 40초 정도 지연됨

 

12:03:00 쯤 매진된 화면 (아래)

8/1(목), 8/8(목) 오전 신청완료

Posted by orasman
카테고리 없음2019. 6. 10. 21:49

2019 김천고 자기주도캠프제 13회 전국 중학생 자기주도학습 캠프 및 경시대회 안내

http://school.gyo6.net/boardCnts/view.do?m=0301&boardID=33397&boardSeq=2265611&lev=0&action=view&s=gimcheon

 

1. 신청기간 : 캠프 인원 400명 선착순 접수 후 종료

 

 

2. 신청방법

- http://naver.me/GqULCSzL 접속하여 작성

- 네이버 로그인을 하셔야 작성이 가능합니다.

 

 

3. 캠프대상자 확정 통보

- 2019. 07. 01.() 17 (학부모 번호로 문자 개별 통보)

- 캠프 인원 초과 시 개별 연락드리겠습니다.

 

4. 문의 전화

- 입학홍보부장 라영운(054-429-9957), 교무실(429-9900, 9701)

 

2018 모집공고 (포천 갈월중 게시판)

http://galwol.ms.kr/board.read?mcode=1710&id=130039122

 

2017 기사

http://www.veritas-a.com/news/articleView.html?idxno=85049

 

2016 블로그

https://m.blog.naver.com/peterroh502/220771517291

 

2014 일정표

https://m.blog.naver.com/myfermat/220031733424

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Posted by orasman