Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Repository for maintaining ROS 1 and ROS 2 codes for Drone Skyways Project

License

NotificationsYou must be signed in to change notification settings

Shobuj-Paul/skyways

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub issuesGitHub licenseUbuntuROS NoeticBuild Status

ROS Installation

Note: ROS 1 installation is required only on onboard computer (or for development). For running a Ground Station, only ROS 2 is required.

  • Install catkin and colcon build systems.
sudo apt install python3-catkin-tools -ysudo apt install python3-colcon-common-extensions -y
  • Installros1_bridge for ROS 2 - ROS 1 message conversions
sudo apt install ros-foxy-ros1-bridge
  • Install MAVROS for ROS 1 communication with PX4 Autopilot.
sudo apt install ros-noetic-mavros ros-noetic-mavros-extras
  • After this install GeographicLib Datasets.
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.shsudo bash install_geographiclib_datasets.sh

NOTE: In case you are unable to install GeographicLib Datasets, check you clock. Time on the computer should be proper. You can set time using this command.

sudo date -s"$(wget -qSO- --max-redirect=0 google.com2>&1| grep Date:| cut -d'' -f5-8)Z"

Environment Setup

  • Create two workspaces, one for ROS 1 and another for ROS 2.
mkdir -p catkin_ws/srcmkdir -p colcon_ws/src
  • Clone the repository and checkout theros-1 branch incatkin_ws/src and follow these instructions to build your workspace.
source /opt/ros/noetic/setup.bashcd~/catkin_ws/srcgit clone https://github.com/Shobuj-Paul/skyways.gitcd skywaysgit checkout ros-1cd ../..catkin build
  • Clone the repository and checkoutros-2 branch (default branch so you can leave as it is) incolcon_ws/src and follow these instructions to build your workspace.
source /opt/ros/foxy/setup.bashcd~/colcon_ws/srcgit clone https://github.com/Shobuj-Paul/skyways.gitcd skywaysgit checkout ros-2cd ../..colcon build --symlink-install
  • Next we need to create aliases for easy sourcing of workspaces. Bash scripts for these have been created in thescripts folder. Change the workspace names and paths accordingly if you have created them in a different directory.

  • Add these aliases to your ~/.bashrc file. With this you will be able to source your workspaces (both overlay and underlay) with commandsnoetic (for ROS 1 and catkin_ws) andfoxy (for ROS 2 and colcon_ws).

alias foxy='source ~/colcon_ws/src/skyways/scripts/foxy.sh'alias noetic='source ~/catkin_ws/src/skyways/scripts/noetic.sh'
  • Set an environment variable in your~/.bashrc file to avoid explicity mentioning it everytime you run you client or control codes.
export DRONE_ID="<name of your drone>"

You can check your variable using this command.

echo$DRONE_ID

Drone Flight Setup

This manual setup is no longer necessary, you can follow the instructions given in the next part to automate this process.

  • Make sure that the onboard computer has permission to read and write to /dev/ttyACM0 port. If that is not the case, you can set permission using the following command.
sudo chmod 777 /dev/ttyACM0

This is done manually and is not permanent, each login requires you to do this manually. It is better to add yourself to dialout group.

usermod -a -G dialout$USERsudo adduser$USER

For Nvidia development boards this alone does not work. You need to setudev rules.

sudoecho'ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="09cb", OWNER=$USER, MODE="0777", GROUP="nvidia"'>> /etc/udev/rules.d/50-usb.rules

Logout and login again for changes to take effect.

  • Open up 4 terminal windows.
  • Source ROS 1. Start MAVROS connection to PX4. Make sure the PX4 controller (Pixhawk or Cube) is connected via serial to USB port on the onboard computer.
noeticroslaunch skyways px4.launch ID:=$DRONE_ID fcu_url:="/dev/ttyACM0"
  • Source ROS 1. Run your control code.
noeticrosrun skyways setpoint_mission$DRONE_ID
  • Source ROS 1. Source ROS 2. Runros1_bridge.
noeticfoxyros2 run ros1_bridge dynamic_bridge --bridge-all-topics
  • Source ROS 2. Run ROS 2 client for sending flight request.
foxyros2 run skyways drone_client$DRONE_ID

Drone Flight Setup on Startup

  • Enable automatic login on Ubuntu from settings.
  • Add terminal as a start up process inStartup Applications with the following command.
gnome-terminal
  • Add the following line to the end of your ~/.bashrc file.
source~/colcon_ws/src/skyways/scripts.startup.sh
  • Reboot. You can check on your Ground Station PC whether the topics are broadcasted via this command.
foxyros2 topic list

Ground Station Command

  • Clone the repository in a ROS 2 workspace on your ground station and build.
source /opt/ros/foxy/setup.bashmkdir -p colcon_ws/srccd colcon_ws/srcgit clone https://github.com/Shobuj-Paul/skyways.gitcd skywaysgit checkout ros-2cd ../..colcon build --symlink-install
  • You can log waypoints from the drone using the following command
ros2 run skyways waypoint_logger<Drone ID>
  • Start the ROS 2 server on Ground Station.
foxyros2 run skyways drone_server

Development

  • All online flight behaviors need to be programmed in ROS 1 package.
  • All offline flight planning needs to programmed in ROS 2 package, within the drone_server.cpp file,void data(const std::shared_ptr<skyways::srv::DataPacket::Request> request, std::shared_ptr<skyways::srv::DataPacket::Response> response) function.

Network

  • To set up Wifi hotspot with Alfa Wifi router, connect the router and run the following command.
nmcli dev wifi hotspot ifname wlx00c0ca980d57 ssid alfa password"abcd1234"

About

Repository for maintaining ROS 1 and ROS 2 codes for Drone Skyways Project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp