2019-07-11 02:22:33 (68.0 MB/s) - written to stdout [1167/1167]
OK
4) 패키지 인덱스 업데이트
소스 리스트에 ROS 저장소 주소를 넣었으니 패키지 리스트를업데이트한다.
설치상에 필수 사항은 아니지만 ROS설치전에 현재 설치된 우분투 관련 모든 패키지를 판올림 하기를 추천한다.
$ sudo apt-get update
$sudo apt-get upgrade
5) ROS Kinetic 설치
데스크탑용은 용량에 제한을 거의 안받기때문에 필요한 패키지들을 포함한 데스크탑 버전을 설치한다.
$ sudo apt-get install ros-kinetic-desktop-full
6) rosdep 초기화
ros를 사용하기전에 rosdep 를 초기화 해주어야만 한다.다
rosdep 는 ros의 핵심 컴포넌트 들을 사용하거나 컴파일 할때 의존성 패키지를 쉽게 설치하여 사용자 편의성을 높인 기능이다.
필요한 환경 변수들을 적용한다. ROS_ROOT, ROS_PACKAGE_PATH 등의 환경 변수들이 정의되어 있다.
$ sudo rosdep init
$ rosdep update
$ source /opt/ros/kinetic/setup.bash
7) rosinstall 설치
ros의 다양한 패키지를 인스톨하는 프로그램
$ sudo apt-get install python-rosinstall
8) MAVLink 설치
ROS와 Mavlink를 연동할 수 있는 패키지 설치
$ sudo apt-get install ros-kinetic-mav*
9) catkin 작업폴더 생성 및 초기화
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
~/catkin_ws/src $ catkin_init_workspace
10) 환경 설정
gedit로 bashrc파일을 수정한다. 배치파일 실행, 네스워크 설정, 단축명령어 등이 설정되어 있다.
MASTER_URI 에 자신의 아이피를 입력한다.
$ gedit ~/.bashrc
# Set ROS kinetic source /opt/ros/kinetic/setup.bash source ~/catkin_ws/devel/setup.bash
# Set ROS Network export ROS_MASTER_URI=http://localhost:11311 export ROS_HOSTNAME=localhost
# set ROS alias command alias cw='cd ~/catkin_ws' alias cs='cd ~/catkin_ws/src' alias cm='cd ~/catkin_ws && catkin_make'
11) roscore 실행
아래와 같이 정상적으로 실행이 되는 확인한다.
$ roscore
... logging to /home/swift/.ros/log/09dd2f20-a33b-11e9-ab22-606c6681e719/roslaunch-swift-HP-Pavilion-dv6-Notebook-PC-14368.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://localhost:42961/ ros_comm version 1.12.14
[ 0%] Built target lockstep_scheduler [ 0%] Built target mixer_gen [ 2%] Built target df_driver_framework [ 2%] Built target uorb_headers [ 2%] Built target mixer_gen_6dof [ 2%] Built target ver_gen [ 2%] Built target drivers_board [ 2%] Built target git_gps_devices [ 3%] Built target git_mavlink_v2 [ 4%] Built target git_ecl Scanning dependencies of target git_gazebo [ 4%] Generating ../../logs [ 4%] git submodule Tools/sitl_gazebo [ 4%] Built target logs_symlink [ 4%] Built target perf [ 4%] Built target tinybson [ 7%] Built target work_queue [ 7%] Built target git_gazebo [ 7%] Built target ecl_airdata [ 8%] Built target ecl_attitude_fw [ 24%] Built target uorb_msgs [ 24%] Built target ecl_geo [ 24%] Built target ecl_geo_lookup [ 24%] Built target ecl_tecs [ 24%] Built target ecl_validation [ 25%] Built target mixer [ 25%] Built target version Scanning dependencies of target sitl_gazebo [ 26%] Built target rc [ 26%] Built target generate_topic_listener [ 26%] Creating directories for 'sitl_gazebo' [ 27%] Built target ecl_l1 [ 27%] Built target parameters [ 28%] Built target px4_layer [ 29%] Built target px4_daemon [ 29%] No download step for 'sitl_gazebo' [ 30%] Built target modules__uORB [ 30%] No update step for 'sitl_gazebo' [ 31%] No patch step for 'sitl_gazebo' [ 32%] Built target px4_work_queue [ 32%] No forceconfigure step for 'sitl_gazebo' [ 32%] Performing configure step for 'sitl_gazebo' [ 34%] Built target px4_platform -- install-prefix: /usr/local [ 35%] Built target systemlib [ 36%] Built target cdev -- The C compiler identification is GNU 5.4.0 [ 36%] Built target battery [ 36%] Built target lib__cdev__test__cdev_test [ 37%] Built target airspeed [ 37%] Built target circuit_breaker [ 37%] Built target CollisionPrevention [ 39%] Built target controllib [ 40%] Built target lib__controllib__controllib_test [ 40%] Built target conversion [ 41%] Built target drivers__device [ 42%] Built target drivers_barometer [ 43%] Built target drivers_magnetometer -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc [ 44%] Built target mathlib [ 44%] Built target FlightTask [ 44%] Built target hysteresis [ 44%] Built target landing_slope [ 44%] Built target pid [ 45%] Built target pwm_limit [ 45%] Built target lib__rc__rc_tests [ 46%] Built target terrain_estimation [ 47%] Built target tunes [ 47%] Built target WeatherVane -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info [ 48%] Built target lib__work_queue__test__wqueue_test [ 49%] Built target modules__uORB__uORB_tests [ 50%] Built target drivers__camera_trigger [ 50%] Built target drivers__pwm_out_sim [ 51%] Built target drivers__gps [ 51%] Built target tone_alarm_interface [ 51%] Built target modules__attitude_estimator_q [ 51%] Built target modules__camera_feedback [ 51%] Built target failure_detector -- Detecting C compiler ABI info - done [ 52%] Built target modules__commander__commander_tests -- Detecting C compile features [ 52%] Built target modules__dataman [ 54%] Built target modules__events [ 54%] Built target modules__fw_att_control [ 55%] Built target launchdetection [ 55%] Built target runway_takeoff [ 56%] Built target modules__gnd_att_control [ 56%] Built target modules__gnd_pos_control [ 57%] Built target modules__land_detector [ 57%] Built target modules__landing_target_estimator [ 58%] Built target modules__load_mon [ 59%] Built target modules__logger [ 60%] Built target modules__local_position_estimator [ 60%] Built target AttitudeControl [ 61%] Built target modules__mavlink__mavlink_tests [ 61%] Built target Takeoff [ 64%] Built target modules__mavlink [ 65%] Built target modules__replay [ 65%] Built target modules__sensors [ 69%] Built target modules__navigator [ 70%] Built target drivers__vmount [ 71%] Built target modules__vtol_att_control [ 71%] Built target modules__wind_estimator [ 71%] Built target systemcmds__dyn -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ [ 72%] Built target systemcmds__esc_calib [ 72%] Built target systemcmds__led_control [ 72%] Built target systemcmds__mixer [ 73%] Built target systemcmds__motor_ramp [ 73%] Built target systemcmds__param [ 73%] Built target systemcmds__perf [ 73%] Built target systemcmds__pwm [ 74%] Built target systemcmds__reboot [ 74%] Built target systemcmds__sd_bench [ 74%] Built target systemcmds__shutdown [ 75%] Built target systemcmds__tests__hrt_test -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info [ 81%] Built target systemcmds__tests [ 81%] Built target systemcmds__top [ 82%] Built target systemcmds__topic_listener [ 82%] Built target systemcmds__ver [ 82%] Built target systemcmds__tune_control [ 83%] Built target modules__bottle_drop [ 83%] Built target examples__hello [ 83%] Built target examples__fixedwing_control [ 83%] Built target modules__position_estimator_inav [ 84%] Built target examples__px4_mavlink_debug [ 84%] Built target examples__px4_simple_app -- Detecting CXX compiler ABI info - done [ 84%] Built target examples__rover_steering_control -- Detecting CXX compile features [ 85%] Built target examples__segway [ 85%] Built target drivers_accelerometer [ 85%] Built target drivers_gyroscope [ 86%] Built target drivers__led [ 88%] Built target ecl_EKF [ 89%] Built target FlightTaskUtility [ 90%] Built target FlightTaskManual [ 91%] Built target FlightTaskOffboard [ 91%] Built target FlightTaskFailsafe [ 91%] Built target FlightTaskTransition [ 92%] Built target drivers__tone_alarm [ 92%] Built target modules__ekf2 [ 94%] Built target modules__commander [ 94%] Built target modules__fw_pos_control_l1 [ 94%] Built target modules__mc_att_control [ 94%] Built target drivers__ledsim [ 95%] Built target FlightTaskAuto [ 95%] Built target FlightTaskManualAltitude [ 95%] Built target FlightTaskAutoMapper [ 96%] Built target modules__simulator [ 96%] Built target FlightTaskAutoMapper2 [ 96%] Built target FlightTaskManualAltitudeSmooth [ 97%] Built target FlightTaskManualAltitudeSmoothVel [ 97%] Built target FlightTaskManualPosition [ 97%] Built target FlightTaskAutoLine [ 98%] Built target FlightTaskAutoLineSmoothVel [ 98%] Built target FlightTaskAutoFollowMe [ 98%] Built target FlightTaskOrbit [ 98%] Built target drivers__gpssim [ 98%] Built target FlightTaskManualPositionSmooth [ 98%] Built target FlightTaskManualPositionSmoothVel [100%] Built target FlightTasks -- Detecting CXX compile features - done -- Performing Test COMPILER_SUPPORTS_CXX17 [100%] Built target modules__mc_pos_control [100%] Built target px4 -- Performing Test COMPILER_SUPPORTS_CXX17 - Success -- Performing Test COMPILER_SUPPORTS_CXX14 -- Performing Test COMPILER_SUPPORTS_CXX14 - Success -- Performing Test COMPILER_SUPPORTS_CXX11 -- Performing Test COMPILER_SUPPORTS_CXX11 - Success -- Performing Test COMPILER_SUPPORTS_CXX0X -- Performing Test COMPILER_SUPPORTS_CXX0X - Success -- Using C++14 compiler -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Boost version: 1.58.0 -- Found the following Boost libraries: -- system -- thread -- filesystem -- chrono -- date_time -- atomic -- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so -- Boost version: 1.58.0 -- Looking for OGRE... -- OGRE_PREFIX_WATCH changed. -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") -- Checking for module 'OGRE' -- Found OGRE, version 1.9.0 -- Found Ogre Ghadamon (1.9.0) -- Found OGRE: optimized;/usr/lib/x86_64-linux-gnu/libOgreMain.so;debug;/usr/lib/x86_64-linux-gnu/libOgreMain.so -- Looking for OGRE_Paging... -- Found OGRE_Paging: optimized;/usr/lib/x86_64-linux-gnu/libOgrePaging.so;debug;/usr/lib/x86_64-linux-gnu/libOgrePaging.so -- Looking for OGRE_Terrain... -- Found OGRE_Terrain: optimized;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so;debug;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so -- Looking for OGRE_Property... -- Found OGRE_Property: optimized;/usr/lib/x86_64-linux-gnu/libOgreProperty.so;debug;/usr/lib/x86_64-linux-gnu/libOgreProperty.so -- Looking for OGRE_RTShaderSystem... -- Found OGRE_RTShaderSystem: optimized;/usr/lib/x86_64-linux-gnu/libOgreRTShaderSystem.so;debug;/usr/lib/x86_64-linux-gnu/libOgreRTShaderSystem.so -- Looking for OGRE_Volume... -- Found OGRE_Volume: optimized;/usr/lib/x86_64-linux-gnu/libOgreVolume.so;debug;/usr/lib/x86_64-linux-gnu/libOgreVolume.so -- Looking for OGRE_Overlay... -- Found OGRE_Overlay: optimized;/usr/lib/x86_64-linux-gnu/libOgreOverlay.so;debug;/usr/lib/x86_64-linux-gnu/libOgreOverlay.so -- Found PythonInterp: /usr/bin/python (found version "2.7.12") -- Found OpenCV: /opt/ros/kinetic (found version "3.3.1") -- Found TinyXML: /usr/lib/x86_64-linux-gnu/libtinyxml.so -- Checking for module 'OGRE' -- Found OGRE, version 1.9.0 -- Building klt_feature_tracker without catkin -- Building OpticalFlow with OpenCV -- Found MAVLink: /home/swift/catkin_ws/src/Firmware/mavlink/include (found version "2.0") -- catkin DISABLED -- Checking for module 'protobuf' -- Found protobuf, version 2.6.1 Gazebo version: 7.0
-- Configuring done -- Generating done -- Build files have been written to: /home/swift/catkin_ws/src/Firmware/build/px4_sitl_default/build_gazebo [100%] Performing build step for 'sitl_gazebo' [ 3%] Running C++ protocol buffer compiler on msgs/Int32.proto [ 3%] Running C++ protocol buffer compiler on msgs/MotorSpeed.proto [ 3%] Running C++ protocol buffer compiler on msgs/Wind.proto [ 4%] Running C++ protocol buffer compiler on msgs/Pressure.proto [ 5%] Running C++ protocol buffer compiler on msgs/Imu.proto [ 6%] Running C++ protocol buffer compiler on msgs/CommandMotorSpeed.proto Scanning dependencies of target physics_msgs Scanning dependencies of target std_msgs [ 8%] Running C++ protocol buffer compiler on msgs/IRLock.proto [ 9%] Running C++ protocol buffer compiler on msgs/Float.proto [ 10%] Building CXX object CMakeFiles/physics_msgs.dir/Wind.pb.cc.o [ 11%] Building CXX object CMakeFiles/std_msgs.dir/Int32.pb.cc.o Scanning dependencies of target mav_msgs [ 12%] Running C++ protocol buffer compiler on msgs/Groundtruth.proto [ 13%] Building CXX object CMakeFiles/mav_msgs.dir/CommandMotorSpeed.pb.cc.o [ 15%] Running C++ protocol buffer compiler on msgs/Range.proto [ 16%] Running C++ protocol buffer compiler on msgs/SITLGps.proto [ 17%] Running C++ protocol buffer compiler on msgs/OpticalFlow.proto [ 18%] Running C++ protocol buffer compiler on msgs/MagneticField.proto Scanning dependencies of target sensor_msgs [ 19%] Building CXX object CMakeFiles/sensor_msgs.dir/Imu.pb.cc.o [ 20%] Linking CXX shared library libstd_msgs.so [ 22%] Building CXX object CMakeFiles/mav_msgs.dir/MotorSpeed.pb.cc.o [ 23%] Linking CXX shared library libphysics_msgs.so [ 23%] Built target std_msgs [ 24%] Running C++ protocol buffer compiler on msgs/Odometry.proto Scanning dependencies of target nav_msgs [ 25%] Building CXX object CMakeFiles/nav_msgs.dir/Odometry.pb.cc.o [ 26%] Building CXX object CMakeFiles/sensor_msgs.dir/IRLock.pb.cc.o [ 26%] Built target physics_msgs Scanning dependencies of target models_gen [ 27%] Generating /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/3DR_gps_mag/3DR_gps_mag-gen.sdf /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/3DR_gps_mag/3DR_gps_mag.sdf.jinja -> /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/3DR_gps_mag/3DR_gps_mag-gen.sdf [ 29%] Generating /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/c920/c920-gen.sdf /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/c920/c920.sdf.jinja -> /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/c920/c920-gen.sdf [ 30%] Generating /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/matrice_100/matrice_100-gen.sdf [ 31%] Linking CXX shared library libmav_msgs.so /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/matrice_100/matrice_100.sdf.jinja -> /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/matrice_100/matrice_100-gen.sdf [ 32%] Generating /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/mb1240-xl-ez4/mb1240-xl-ez4-gen.sdf /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/mb1240-xl-ez4/mb1240-xl-ez4.sdf.jinja -> /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/mb1240-xl-ez4/mb1240-xl-ez4-gen.sdf [ 33%] Generating /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/pixhawk/pixhawk-gen.sdf [ 33%] Built target mav_msgs Scanning dependencies of target sdf [ 34%] Generating /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf [ 36%] Building CXX object CMakeFiles/sensor_msgs.dir/Float.pb.cc.o /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/pixhawk/pixhawk.sdf.jinja -> /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/pixhawk/pixhawk-gen.sdf [ 37%] Generating /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/px4flow/px4flow-gen.sdf /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/px4flow/px4flow.sdf.jinja -> /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/px4flow/px4flow-gen.sdf [ 38%] Linking CXX shared library libnav_msgs.so [ 39%] Generating /home/swift/catkin_ws/src/Firmware/Tools/sitl_gazebo/models/r200/r200-gen.sdf
[Msg] Waiting for master. [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [Msg] Publicized address: 192.168.219.165 [Wrn] [gazebo_barometer_plugin.cpp:66] [gazebo_barometer_plugin] Using default home altitude of 488 m [Dbg] [gazebo_mavlink_interface.cpp:135] not found for channel[0] no joint control will be performed for this channel. [Dbg] [gazebo_mavlink_interface.cpp:135] not found for channel[1] no joint control will be performed for this channel. [Dbg] [gazebo_mavlink_interface.cpp:135] not found for channel[2] no joint control will be performed for this channel. [Dbg] [gazebo_mavlink_interface.cpp:135] not found for channel[3] no joint control will be performed for this channel. [Wrn] [gazebo_mavlink_interface.cpp:124] joint [zephyr_delta_wing::propeller_joint] not found for channel[4] no joint control for this channel. [Wrn] [gazebo_mavlink_interface.cpp:124] joint [zephyr_delta_wing::flap_left_joint] not found for channel[5] no joint control for this channel. [Wrn] [gazebo_mavlink_interface.cpp:124] joint [zephyr_delta_wing::flap_right_joint] not found for channel[6] no joint control for this channel. [Dbg] [gazebo_mavlink_interface.cpp:135] not found for channel[7] no joint control will be performed for this channel. [Msg] Connecting to PX4 SITL using TCP [Msg] Lockstep is enabled [Msg] Speed factor set to: 1 SITL COMMAND: "/home/swift/catkin_ws/src/Firmware/build/px4_sitl_default/bin/px4" "/home/swift/catkin_ws/src/Firmware"/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t "/home/swift/catkin_ws/src/Firmware"/test_data INFO [px4] Creating symlink /home/swift/catkin_ws/src/Firmware/ROMFS/px4fmu_common -> /home/swift/catkin_ws/src/Firmware/build/px4_sitl_default/tmp/rootfs/etc 0 WARNING: setRealtimeSched failed (not run as root?)
[Msg] Waiting for master. [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [Msg] Publicized address: 192.168.219.165 [Wrn] [Publisher.cc:140] Queue limit reached for topic /gazebo/default/iris/motors, deleting message. This warning is printed only once. [Wrn] [Publisher.cc:140] Queue limit reached for topic /gazebo/default/iris/motor_speed/0, deleting message. This warning is printed only once. [Wrn] [Publisher.cc:140] Queue limit reached for topic /gazebo/default/iris/motor_speed/1, deleting message. This warning is printed only once. [Wrn] [Publisher.cc:140] Queue limit reached for topic /gazebo/default/iris/motor_speed/2, deleting message. This warning is printed only once. [Wrn] [Publisher.cc:140] Queue limit reached for topic /gazebo/default/iris/motor_speed/3, deleting message. This warning is printed only once. INFO [px4_work_queue] creating: wq:hp_default, priority: 87, stack: 16384 bytes INFO [init] Mixer: etc/mixers/quad_w.main.mix on /dev/pwm_output0 INFO [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 14570 remote port 14550 INFO [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540 INFO [logger] logger started (mode=all) INFO [logger] Start file log (type: full) INFO [logger] Opened full log file: ./log/2019-07-10/18_00_36.ulg INFO [mavlink] MAVLink only on localhost (set param MAV_BROADCAST = 1 to enable network) INFO [px4] Startup script returned successfully pxh> INFO [ekf2] Mag sensor ID changed to 197388 INFO [ecl/EKF] EKF GPS checks passed (WGS-84 origin set) INFO [ecl/EKF] EKF aligned, (pressure height, IMU buf: 22, OBS buf: 14) INFO [ecl/EKF] EKF commencing GPS fusion [Wrn] [Publisher.cc:140] Queue limit reached for topic /gazebo/default/user_camera/pose, deleting message. This warning is printed only once.
gazebo가 실행되면서 3D Robotics 사의 IRIS 모델이 정상적으로 로딩되었다.
하드웨어는 없지만 펌웨어만으로 gazebo라는 가상공간에서 시험을 해볼 수 있는 것이다.
간단한 명령인 takeoff를 주면 IRIS가 제자리에서 상공으로 호버링하다가 다시 랜딩하는 것을 볼 수 있다.
pxh> commander takeoff
pxh> INFO [logger] Start file log (type: full) INFO [logger] Opened full log file: ./log/2019-07-10/18_10_26.ulg INFO [commander] Takeoff detected WARN [commander] Failsafe enabled: no datalink INFO [navigator] RTL HOME activated INFO [navigator] RTL: climb to 11 m (10 m above home) INFO [navigator] RTL: return at 11 m (10 m above home) INFO [navigator] RTL: land at home INFO [commander] Landing detected INFO [logger] closed logfile, bytes written: 1691912
다음 포스팅은 QGroundControl 과 연동하여 자동 미션수행 및 경로비행등을 SITL에서 수행해볼 예정이다.
댓글