이 글은 ROS melodic과 MAVROS를 설치하고 이를 검증하기위해 적었습니다.
This post is written for installing ROS melodic and MAVROS, and verifying them.
1. Install ROS for PX4
dev.px4.io/v1.9.0/en/setup/dev_env_linux_ubuntu.html
source ubuntu_sim_ros_melodic.sh
2. build mavros
cd ~/catkin_ws/src
catkin build
3. build mavros sample for verifying[1]
-> Position Control using mavros
cd ~/catkin_ws/src
git clone https://github.com/Jaeyoung-Lim/modudculab_ros.git
catkin build modudculab_ros
-> but, it doesnt work.
-> add dependency to package.sml and find_package list
gedit modudculab_ros/CMakeLists.txt # add mavros_msgs
1
2
3
4
5
6
|
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
mavros_msgs
)
|
cs |
gedit modudculab_ros/package.xml # add mavros_msgs
1
2
3
4
5
6
7
8
9
|
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>mavros_msgs</build_depend>
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>mavros_msgs</run_depend>
|
cs |
-> then type below command
catkin build modudculab_ros
4. make px4
-> if you have already them, dont have to do below, but do make.
cd ~/src/Firmware
make px4_sitl_default gazebo
-> it gazebo and iris quadrotor appear, the make process works.
5. test mavros via modudculab_ros[1]
-> change fcu_url for sitl
-> Remarked line for HITL
gedit modudculab_ros/launch/ctrl_pos_gazebo.launch
1
2
|
<arg name="fcu_url" default= "udp://:14540@127.0.0.1:14557">
<!-- <arg name="fcu_url" default= "/dev/ttyUSB0:921600" /> -->
|
cs |
-> Terminal 1 : turn on sitl on gazebo
make px4_sitl_default gazebo
(if you wanna run jmavsim, not gazebo, type following line on your console)
make px4_sitl jmavsim
-> Terminal 2 : turn on ROS
roscore
-> Terminal 3 : turn on mavros publisher (Position Setpoint)
roslaunch modudculab_ros ctrl_pos_gazebo.launch
-> Terminal 4 : arming
rosrun mavros mavsafety arm
-> Terminal 4 : change flight mode to OFFBOARD
rosrun mavros mavsys mode -c OFFBOARD
-> if you process this line, you may watch below the video.
Node Graph
Node Graph with Topics
This post is refered below :
[1] Software-in-the-loop (SITL), dnddnjs.gitbooks.io/drone-autonomous-flight/content/software_in_the_loopsitl.html
[2] More about SITL, dnddnjs.gitbooks.io/drone-autonomous-flight/content/more_about_sitl.html
[3] Development Environment on Ubuntu LTS / Debian Linux, dev.px4.io/v1.9.0/en/setup/dev_env_linux_ubuntu.html
Thanks to authors and ancestors.
'UAV > ROS' 카테고리의 다른 글
ROS Upstart package (0) | 2021.04.03 |
---|---|
[ROS] spin, spinonce, rate.sleep의 차이는..? (0) | 2021.02.05 |
[실수모음] ROS - Unknown CMake command "add_message_files" (0) | 2020.11.28 |