Compare commits

..

1 Commits

Author SHA1 Message Date
Oleg Kalachev
a73efce116 Start working on web pages header 2020-05-07 07:08:20 +03:00
112 changed files with 4651 additions and 57100 deletions

View File

@@ -83,18 +83,18 @@ jobs:
- ./check_unused_assets.py
- gitbook install
- gitbook build
# deploy:
# provider: pages
# local_dir: _book
# skip_cleanup: true
# token: ${GITHUB_OAUTH_TOKEN}
# keep_history: true
# target_branch: master
# repo: CopterExpress/clover.coex.tech
# fqdn: clover.coex.tech
# verbose: true
# on:
# branch: master
deploy:
provider: pages
local_dir: _book
skip_cleanup: true
token: ${GITHUB_OAUTH_TOKEN}
keep_history: true
target_branch: master
repo: CopterExpress/clover.coex.tech
fqdn: clover.coex.tech
verbose: true
on:
branch: master
- stage: Annotate
name: Auto-generate changelog
language: python

View File

@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.0)
project(aruco_pose)
add_definitions(-std=c++11 -Wall -g)
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
@@ -23,7 +25,7 @@ find_package(catkin REQUIRED COMPONENTS
)
find_package(OpenCV 3 REQUIRED COMPONENTS core imgproc calib3d)
if ("${OpenCV_VERSION_MINOR}" LESS "9")
if ("${OpenCV_VERSION_MINOR}" LESS "3")
message(STATUS "OpenCV version too low, using vendored ArUco package")
include(vendor/VendorOpenCV.cmake)
else()
@@ -227,5 +229,4 @@ if (CATKIN_ENABLE_TESTING)
add_rostest(test/test_parser_empty_map.test)
add_rostest(test/test_node_failure.test)
add_rostest(test/largemap.test)
add_rostest(test/crash_opencv.test)
endif()

View File

@@ -58,9 +58,10 @@ using cv::Mat;
class ArucoDetect : public nodelet::Nodelet {
private:
std::unique_ptr<tf2_ros::TransformBroadcaster> br_;
std::unique_ptr<tf2_ros::Buffer> tf_buffer_;
std::unique_ptr<tf2_ros::TransformListener> tf_listener_;
ros::NodeHandle nh_, nh_priv_;
tf2_ros::TransformBroadcaster br_;
tf2_ros::Buffer tf_buffer_;
tf2_ros::TransformListener tf_listener_{tf_buffer_};
std::shared_ptr<dynamic_reconfigure::Server<aruco_pose::DetectorConfig>> dyn_srv_;
cv::Ptr<cv::aruco::Dictionary> dictionary_;
cv::Ptr<cv::aruco::DetectorParameters> parameters_;
@@ -80,32 +81,30 @@ private:
public:
virtual void onInit()
{
ros::NodeHandle& nh_ = getNodeHandle();
ros::NodeHandle& nh_priv_ = getPrivateNodeHandle();
br_.reset(new tf2_ros::TransformBroadcaster());
tf_buffer_.reset(new tf2_ros::Buffer());
tf_listener_.reset(new tf2_ros::TransformListener(*tf_buffer_, nh_));
nh_ = getNodeHandle();
nh_priv_ = getPrivateNodeHandle();
int dictionary;
dictionary = nh_priv_.param("dictionary", 2);
estimate_poses_ = nh_priv_.param("estimate_poses", true);
send_tf_ = nh_priv_.param("send_tf", true);
nh_priv_.param("dictionary", dictionary, 2);
nh_priv_.param("estimate_poses", estimate_poses_, true);
nh_priv_.param("send_tf", send_tf_, true);
if (estimate_poses_ && !nh_priv_.getParam("length", length_)) {
NODELET_FATAL("can't estimate marker's poses as ~length parameter is not defined");
ros::shutdown();
}
readLengthOverride(nh_priv_);
readLengthOverride();
known_tilt_ = nh_priv_.param<std::string>("known_tilt", "");
auto_flip_ = nh_priv_.param("auto_flip", false);
nh_priv_.param<std::string>("known_tilt", known_tilt_, "");
nh_priv_.param("auto_flip", auto_flip_, false);
frame_id_prefix_ = nh_priv_.param<std::string>("frame_id_prefix", "aruco_");
nh_priv_.param<std::string>("frame_id_prefix", frame_id_prefix_, "aruco_");
camera_matrix_ = cv::Mat::zeros(3, 3, CV_64F);
dist_coeffs_ = cv::Mat::zeros(8, 1, CV_64F);
dictionary_ = cv::aruco::getPredefinedDictionary(static_cast<cv::aruco::PREDEFINED_DICTIONARY_NAME>(dictionary));
parameters_ = cv::aruco::DetectorParameters::create();
parameters_->cornerRefinementMethod = cv::aruco::CORNER_REFINE_SUBPIX;
image_transport::ImageTransport it(nh_);
image_transport::ImageTransport it_priv(nh_priv_);
@@ -171,8 +170,8 @@ private:
if (!known_tilt_.empty()) {
try {
snap_to = tf_buffer_->lookupTransform(msg->header.frame_id, known_tilt_,
msg->header.stamp, ros::Duration(0.02));
snap_to = tf_buffer_.lookupTransform(msg->header.frame_id, known_tilt_,
msg->header.stamp, ros::Duration(0.02));
} catch (const tf2::TransformException& e) {
NODELET_WARN_THROTTLE(5, "can't snap: %s", e.what());
}
@@ -206,7 +205,7 @@ private:
if (map_markers_ids_.find(ids[i]) == map_markers_ids_.end()) {
transform.transform.rotation = marker.pose.orientation;
fillTranslation(transform.transform.translation, tvecs[i]);
br_->sendTransform(transform);
br_.sendTransform(transform);
}
}
}
@@ -327,10 +326,10 @@ private:
return frame_id_prefix_ + std::to_string(id);
}
void readLengthOverride(ros::NodeHandle& nh)
void readLengthOverride()
{
std::map<std::string, double> length_override;
nh.getParam("length_override", length_override);
nh_priv_.getParam("length_override", length_override);
for (auto const& item : length_override) {
length_override_[std::stoi(item.first)] = item.second;
}

View File

@@ -58,6 +58,7 @@ typedef message_filters::sync_policies::ExactTime<Image, CameraInfo, MarkerArray
class ArucoMap : public nodelet::Nodelet {
private:
ros::NodeHandle nh_, nh_priv_;
ros::Publisher img_pub_, pose_pub_, markers_pub_, vis_markers_pub_;
image_transport::Publisher debug_pub_;
message_filters::Subscriber<Image> image_sub_;
@@ -82,8 +83,8 @@ private:
public:
virtual void onInit()
{
ros::NodeHandle &nh_ = getNodeHandle();
ros::NodeHandle &nh_priv_ = getPrivateNodeHandle();
nh_ = getNodeHandle();
nh_priv_ = getPrivateNodeHandle();
image_transport::ImageTransport it_priv(nh_priv_);
@@ -95,18 +96,19 @@ public:
board_->dictionary = cv::aruco::getPredefinedDictionary(
static_cast<cv::aruco::PREDEFINED_DICTIONARY_NAME>(nh_priv_.param("dictionary", 2)));
camera_matrix_ = cv::Mat::zeros(3, 3, CV_64F);
dist_coeffs_ = cv::Mat::zeros(8, 1, CV_64F);
std::string type, map;
type = nh_priv_.param<std::string>("type", "map");
transform_.child_frame_id = nh_priv_.param<std::string>("frame_id", "aruco_map");
known_tilt_ = nh_priv_.param<std::string>("known_tilt", "");
auto_flip_ = nh_priv_.param("auto_flip", false);
image_width_ = nh_priv_.param("image_width" , 2000);
image_height_ = nh_priv_.param("image_height", 2000);
image_margin_ = nh_priv_.param("image_margin", 200);
image_axis_ = nh_priv_.param("image_axis", true);
markers_parent_frame_ = nh_priv_.param<std::string>("markers/frame_id", transform_.child_frame_id);
markers_frame_ = nh_priv_.param<std::string>("markers/child_frame_id_prefix", "");
nh_priv_.param<std::string>("type", type, "map");
nh_priv_.param<std::string>("frame_id", transform_.child_frame_id, "aruco_map");
nh_priv_.param<std::string>("known_tilt", known_tilt_, "");
nh_priv_.param("auto_flip", auto_flip_, false);
nh_priv_.param("image_width", image_width_, 2000);
nh_priv_.param("image_height", image_height_, 2000);
nh_priv_.param("image_margin", image_margin_, 200);
nh_priv_.param("image_axis", image_axis_, true);
nh_priv_.param<std::string>("markers/frame_id", markers_parent_frame_, transform_.child_frame_id);
nh_priv_.param<std::string>("markers/child_frame_id_prefix", markers_frame_, "");
// createStripLine();
@@ -114,7 +116,7 @@ public:
param(nh_priv_, "map", map);
loadMap(map);
} else if (type == "gridboard") {
createGridBoard(nh_priv_);
createGridBoard();
} else {
NODELET_FATAL("unknown type: %s", type.c_str());
ros::shutdown();
@@ -329,7 +331,7 @@ publish_debug:
NODELET_INFO("loading %s complete (%d markers)", filename.c_str(), static_cast<int>(board_->ids.size()));
}
void createGridBoard(ros::NodeHandle& nh)
void createGridBoard()
{
NODELET_INFO("generate gridboard");
NODELET_WARN("gridboard maps are deprecated");
@@ -337,15 +339,15 @@ publish_debug:
int markers_x, markers_y, first_marker;
double markers_side, markers_sep_x, markers_sep_y;
std::vector<int> marker_ids;
markers_x = nh.param("markers_x", 10);
markers_y = nh.param("markers_y", 10);
first_marker = nh.param("first_marker", 0);
nh_priv_.param<int>("markers_x", markers_x, 10);
nh_priv_.param<int>("markers_y", markers_y, 10);
nh_priv_.param<int>("first_marker", first_marker, 0);
param(nh, "markers_side", markers_side);
param(nh, "markers_sep_x", markers_sep_x);
param(nh, "markers_sep_y", markers_sep_y);
param(nh_priv_, "markers_side", markers_side);
param(nh_priv_, "markers_sep_x", markers_sep_x);
param(nh_priv_, "markers_sep_y", markers_sep_y);
if (nh.getParam("marker_ids", marker_ids)) {
if (nh_priv_.getParam("marker_ids", marker_ids)) {
if ((unsigned int)(markers_x * markers_y) != marker_ids.size()) {
NODELET_FATAL("~marker_ids length should be equal to ~markers_x * ~markers_y");
ros::shutdown();

View File

@@ -35,7 +35,9 @@ static void parseCameraInfo(const sensor_msgs::CameraInfoConstPtr& cinfo, cv::Ma
for (unsigned int i = 0; i < 3; ++i)
for (unsigned int j = 0; j < 3; ++j)
matrix.at<double>(i, j) = cinfo->K[3 * i + j];
dist = cv::Mat(cinfo->D, true);
for (unsigned int k = 0; k < cinfo->D.size(); k++)
dist.at<double>(k) = cinfo->D[k];
}
inline void rotatePoint(cv::Point3f& p, cv::Point3f origin, float angle)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

View File

@@ -1,18 +0,0 @@
import rospy
import pytest
from visualization_msgs.msg import MarkerArray as VisMarkerArray
@pytest.fixture
def node():
return rospy.init_node('aruco_pose_opencv_crash', anonymous=True)
def test_opencv_crashes_img01(node):
rospy.wait_for_message('aruco_detect_01/visualization', VisMarkerArray, timeout=5)
def test_opencv_crashes_img02(node):
rospy.wait_for_message('aruco_detect_02/visualization', VisMarkerArray, timeout=5)
def test_opencv_crashes_img03(node):
rospy.wait_for_message('aruco_detect_03/visualization', VisMarkerArray, timeout=5)

View File

@@ -1,51 +0,0 @@
<launch>
<arg name="corner_method" default="2"/>
<node pkg="image_publisher" type="image_publisher" name="imgpub_01" args="$(find aruco_pose)/test/crash_image_01.png">
<param name="frame_id" value="main_camera_optical"/>
<param name="publish_rate" value="10"/>
<param name="camera_info_url" value="file://$(find aruco_pose)/test/camera_info.yaml" />
</node>
<node pkg="image_publisher" type="image_publisher" name="imgpub_02" args="$(find aruco_pose)/test/crash_image_02.png">
<param name="frame_id" value="main_camera_optical"/>
<param name="publish_rate" value="10"/>
<param name="camera_info_url" value="file://$(find aruco_pose)/test/camera_info.yaml" />
</node>
<node pkg="image_publisher" type="image_publisher" name="imgpub_03" args="$(find aruco_pose)/test/crash_image_03.png">
<param name="frame_id" value="main_camera_optical"/>
<param name="publish_rate" value="10"/>
<param name="camera_info_url" value="file://$(find aruco_pose)/test/camera_info.yaml" />
</node>
<node pkg="nodelet" type="nodelet" name="nodelet_manager_01" args="manager"/>
<node pkg="nodelet" clear_params="true" type="nodelet" name="aruco_detect_01" args="load aruco_pose/aruco_detect nodelet_manager_01">
<remap from="image_raw" to="imgpub_01/image_raw"/>
<remap from="camera_info" to="imgpub_01/camera_info"/>
<param name="length" value="0.33"/>
<param name="cornerRefinementMethod" value="$(arg corner_method)"/>
</node>
<node pkg="nodelet" type="nodelet" name="nodelet_manager_02" args="manager"/>
<node pkg="nodelet" clear_params="true" type="nodelet" name="aruco_detect_02" args="load aruco_pose/aruco_detect nodelet_manager_02">
<remap from="image_raw" to="imgpub_02/image_raw"/>
<remap from="camera_info" to="imgpub_02/camera_info"/>
<param name="length" value="0.33"/>
<param name="cornerRefinementMethod" value="$(arg corner_method)"/>
</node>
<node pkg="nodelet" type="nodelet" name="nodelet_manager_03" args="manager"/>
<node pkg="nodelet" clear_params="true" type="nodelet" name="aruco_detect_03" args="load aruco_pose/aruco_detect nodelet_manager_03">
<remap from="image_raw" to="imgpub_03/image_raw"/>
<remap from="camera_info" to="imgpub_03/camera_info"/>
<param name="length" value="0.33"/>
<param name="cornerRefinementMethod" value="$(arg corner_method)"/>
</node>
<param name="test_module" value="$(find aruco_pose)/test/crash_opencv.py"/>
<test test-name="crash_opencv" pkg="ros_pytest" type="ros_pytest_runner"/>
</launch>

View File

@@ -924,8 +924,6 @@ static void _refineCandidateLines(std::vector<Point>& nContours, std::vector<Poi
// calculate the line :: who passes through the grouped points
Point3f lines[4];
for(int i=0; i<4; i++){
// Don't try to "interpolate" single points
if (cntPts[i].size() < 2) return;
lines[i]=_interpolate2Dline(cntPts[i]);
}

View File

@@ -57,10 +57,6 @@ my_travis_retry() {
return $result
}
echo_stamp "Increase apt retries"
echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries
echo_stamp "Install apt keys & repos"
# TODO: This STDOUT consist 'OK'

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# Perform a "standalone install" in a Docker container
set -e
# Step 1: Install pip
apt update
apt install -y curl

View File

@@ -10,13 +10,11 @@
<remap from="image_raw" to="main_camera/image_raw"/>
<remap from="camera_info" to="main_camera/camera_info"/>
<remap from="map_markers" to="aruco_map/markers" if="$(arg aruco_map)"/>
<param name="cornerRefinementMethod" value="2"/>
<param name="estimate_poses" value="true"/>
<param name="send_tf" value="true"/>
<param name="known_tilt" value="map"/>
<param name="length" value="0.33"/>
<!-- aruco detector parameters -->
<param name="cornerRefinementMethod" value="2"/> <!-- contour refinement -->
<param name="minMarkerPerimeterRate" value="0.075"/> <!-- 0.075 for 320x240, 0.0375 for 640x480 -->
</node>
<!-- aruco_map: estimate aruco map pose -->

View File

@@ -34,7 +34,9 @@ class OpticalFlow : public nodelet::Nodelet
{
public:
OpticalFlow():
camera_matrix_(3, 3, CV_64F)
camera_matrix_(3, 3, CV_64F),
dist_coeffs_(8, 1, CV_64F),
tf_listener_(tf_buffer_)
{}
private:
@@ -50,8 +52,8 @@ private:
Mat hann_;
Mat prev_, curr_;
Mat camera_matrix_, dist_coeffs_;
std::unique_ptr<tf2_ros::Buffer> tf_buffer_;
std::unique_ptr<tf2_ros::TransformListener> tf_listener_;
tf2_ros::Buffer tf_buffer_;
tf2_ros::TransformListener tf_listener_;
bool calc_flow_gyro_;
void onInit()
@@ -61,14 +63,11 @@ private:
image_transport::ImageTransport it(nh);
image_transport::ImageTransport it_priv(nh_priv);
tf_buffer_.reset(new tf2_ros::Buffer());
tf_listener_.reset(new tf2_ros::TransformListener(*tf_buffer_, nh));
local_frame_id_ = nh.param<std::string>("mavros/local_position/tf/frame_id", "map");
fcu_frame_id_ = nh.param<std::string>("mavros/local_position/tf/child_frame_id", "base_link");
roi_px_ = nh_priv.param("roi", 128);
roi_rad_ = nh_priv.param("roi_rad", 0.0);
calc_flow_gyro_ = nh_priv.param("calc_flow_gyro", false);
nh.param<std::string>("mavros/local_position/tf/frame_id", local_frame_id_, "map");
nh.param<std::string>("mavros/local_position/tf/child_frame_id", fcu_frame_id_, "base_link");
nh_priv.param("roi", roi_px_, 128);
nh_priv.param("roi_rad", roi_rad_, 0.0);
nh_priv.param("calc_flow_gyro", calc_flow_gyro_, false);
img_sub_ = it.subscribeCamera("image_raw", 1, &OpticalFlow::flow, this);
img_pub_ = it_priv.advertise("debug", 1);
@@ -92,7 +91,9 @@ private:
camera_matrix_.at<double>(i, j) = cinfo->K[3 * i + j];
}
}
dist_coeffs_ = cv::Mat(cinfo->D, true);
for (int k = 0; k < cinfo->D.size(); k++) {
dist_coeffs_.at<double>(k) = cinfo->D[k];
}
}
void drawFlow(Mat& frame, double x, double y, double quality) const
@@ -185,7 +186,7 @@ private:
flow_camera.vector.x = flow_y; // +y means counter-clockwise rotation around Y axis
flow_camera.vector.y = -flow_x; // +x means clockwise rotation around X axis
try {
tf_buffer_->transform(flow_camera, flow_fcu, fcu_frame_id_);
tf_buffer_.transform(flow_camera, flow_fcu, fcu_frame_id_);
} catch (const tf2::TransformException& e) {
// transform is not available yet
return;
@@ -199,7 +200,7 @@ private:
try {
auto flow_gyro_camera = calcFlowGyro(msg->header.frame_id, prev_stamp_, msg->header.stamp);
static geometry_msgs::Vector3Stamped flow_gyro_fcu;
tf_buffer_->transform(flow_gyro_camera, flow_gyro_fcu, fcu_frame_id_);
tf_buffer_.transform(flow_gyro_camera, flow_gyro_fcu, fcu_frame_id_);
flow_.integrated_xgyro = flow_gyro_fcu.vector.x;
flow_.integrated_ygyro = flow_gyro_fcu.vector.y;
flow_.integrated_zgyro = flow_gyro_fcu.vector.z;
@@ -246,8 +247,8 @@ private:
geometry_msgs::Vector3Stamped calcFlowGyro(const std::string& frame_id, const ros::Time& prev, const ros::Time& curr)
{
tf2::Quaternion prev_rot, curr_rot;
tf2::fromMsg(tf_buffer_->lookupTransform(frame_id, local_frame_id_, prev).transform.rotation, prev_rot);
tf2::fromMsg(tf_buffer_->lookupTransform(frame_id, local_frame_id_, curr, ros::Duration(0.1)).transform.rotation, curr_rot);
tf2::fromMsg(tf_buffer_.lookupTransform(frame_id, local_frame_id_, prev).transform.rotation, prev_rot);
tf2::fromMsg(tf_buffer_.lookupTransform(frame_id, local_frame_id_, curr, ros::Duration(0.1)).transform.rotation, curr_rot);
geometry_msgs::Vector3Stamped flow;
flow.header.frame_id = frame_id;

1
clover/www/img/coex.svg Normal file
View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?> <!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Слой_1" x="0px" y="0px" viewBox="0 0 1224.8 637.4" style="enable-background:new 0 0 1224.8 637.4;" xml:space="preserve"> <style type="text/css"> .st0{fill:#FFFFFF;} </style> <g> <g> <rect x="621.2" y="212.9" class="st0" width="160.1" height="18.5"></rect> <rect x="621.2" y="406.9" class="st0" width="160.1" height="18.5"></rect> <rect x="621.2" y="309.4" class="st0" width="160.1" height="18.5"></rect> </g> <g> <path class="st0" d="M496.7,406.5c-45.3,0-82.6-34.5-87.1-78.6H391c4.4,54.5,50.1,97.4,105.7,97.4c55.5,0,101.1-43,105.7-97.4 h-18.6C579.3,372,541.9,406.5,496.7,406.5z"></path> <path class="st0" d="M496.7,231.4c45,0,82.2,34.2,87,78h18.6c-4.9-54-50.4-96.5-105.6-96.5c-55.1,0-100.6,42.4-105.6,96.5h18.6 C414.4,265.6,451.6,231.4,496.7,231.4z"></path> </g> <g> <polygon class="st0" points="982.7,246 982.8,246 1011.9,212.9 987.2,212.9 918.3,291.1 930.6,305.1 "></polygon> <polygon class="st0" points="905.9,305.1 905.9,305.1 824.5,212.9 799.8,212.9 893.5,319.1 799.8,425.4 824.5,425.4 905.9,333.2 905.9,333.2 918.3,319.1 "></polygon> <polygon class="st0" points="918.2,347.1 987.2,425.4 1011.9,425.4 930.6,333.1 "></polygon> </g> <path class="st0" d="M230.3,318.7c0-48.4,39.3-87.7,87.7-87.7h53.9v-18.5H317c-58,0.7-105.2,48.3-105.2,106.2 c0,57.8,45.4,104.5,103.6,106.2h56.8v-18.5H318C269.6,406.4,230.3,367,230.3,318.7z"></path> </g> </svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,3 +1,15 @@
<style>
body { margin: 0; font-family: 'Roboto', Arial; }
header { height: 67px; background: black; position: relative; }
header .logo { display: block; width: 160px; height: 83px; background: url(img/coex.svg) 100% 100%;}
header .clover { position: absolute; right: 100px; top: 10px; font-size: 35px; }
</style>
<header>
<a href="/" class=logo></a>
<div class=clover>&#127808;</div>
</header>
<h1>Clover Drone Kit Tools</h1>
<ul>

58993
clover/www/js/ros3d.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

View File

@@ -11,7 +11,6 @@
* [Initial setup](setup.md)
* [Sensor calibration](calibration.md)
* [RC setup](radio.md)
* [Using FS-A8S](rc_flysky_a8s.md)
* [Flight modes](modes.md)
* [Power setup](power.md)
* [Failsafe configuration](failsafe.md)
@@ -42,8 +41,7 @@
* [Interfacing with a sonar](sonar.md)
* [Computer vision basics](camera.md)
* [Using rviz and rqt](rviz.md)
* [Software autorun](autolaunch.md)
* [Using JavaScript](javascript.md)
* [Software autorun](autolaunch.md)
* [ROS](ros.md)
* [MAVROS](mavros.md)
* Supplementary materials
@@ -89,5 +87,4 @@
* [Copter Hack 2019](copterhack2019.md)
* [Copter Hack 2018](copterhack2018.md)
* [Copter Hack 2017](copterhack2017.md)
* [Robocross-2019](robocross2019.md)
* [Camera calibration (legacy)](camera_calib.md)

View File

@@ -21,19 +21,19 @@ The obtained folder `ros_lib` is to be copied to `<sketches folder>/libraries` o
To run the program on Arduino once, you can use command:
```(bash)
roslaunch clover arduino.launch
roslaunch clever arduino.launch
```
To start the link with Arduino at the startup automatically, set argument `arudino` in the Clover launch file (`~/catkin_ws/src/clover/clover/launch/clover.launch`):
To start the link with Arduino at the startup automatically, set argument `arudino` in the Clover launch file (`~/catkin_ws/src/clever/clever/launch/clever.launch`):
```xml
<arg name="arduino" default="true"/>
```
After the launch file is edited, restart the `clover` service:
After the launch file is edited, restart package `clever`:
```(bash)
sudo systemctl restart clover
sudo systemctl restart clever
```
## Delays
@@ -70,10 +70,10 @@ An example of a program that controls the copter by position using the `navigate
#include <ros.h>
// Connecting Clover and MAVROS package message header files
#include <clover/Navigate.h>
#include <clever/Navigate.h>
#include <mavros_msgs/SetMode.h>
using namespace clover;
using namespace clever;
using namespace mavros_msgs;
ros::NodeHandle nh;
@@ -174,7 +174,7 @@ With Arduino, you can use the [`get_telemetry` service](simple_offboard.md). To
// ...
#include <clover/GetTelemetry.h>
#include <clever/GetTelemetry.h>
// ...

View File

@@ -10,13 +10,13 @@
## Configuration
Set the `aruco` argument in `~/catkin_ws/src/clover/clover/launch/clover.launch` to `true`:
Set the `aruco` argument in `~/catkin_ws/src/clever/clever/launch/clever.launch` to `true`:
```xml
<arg name="aruco" default="true"/>
```
In order to enable map detection set `aruco_map` and `aruco_detect` arguments to `true` in `~/catkin_ws/src/clover/clover/launch/aruco.launch`:
In order to enable map detection set `aruco_map` and `aruco_detect` arguments to `true` in `~/catkin_ws/src/clever/clever/launch/aruco.launch`:
```xml
<arg name="aruco_detect" default="true"/>
@@ -45,12 +45,12 @@ Map path is defined in the `map` parameter:
<param name="map" value="$(find aruco_pose)/map/map.txt"/>
```
Some map examples are provided in [`~/catkin_ws/src/clover/aruco_pose/map`](https://github.com/CopterExpress/clover/tree/master/aruco_pose/map).
Some map examples are provided in [`~/catkin_ws/src/clever/aruco_pose/map`](https://github.com/CopterExpress/clover/tree/master/aruco_pose/map).
Grid maps may be generated using the `genmap.py` script:
```bash
rosrun aruco_pose genmap.py length x y dist_x dist_y first > ~/catkin_ws/src/clover/aruco_pose/map/test_map.txt
rosrun aruco_pose genmap.py length x y dist_x dist_y first > ~/catkin_ws/src/clever/aruco_pose/map/test_map.txt
```
`length` is the size of each marker, `x` is the marker count along the *x* axis, `y` is the marker count along the *y* axis, `dist_x` is the distance between the centers of adjacent markers along the *x* axis, `dist_y` is the distance between the centers of the *y* axis, `first` is the ID of the first marker (top left marker, unless `--bottom-left` is specified), `test_map.txt` is the name of the generated map file. The optional `--bottom-left` parameter changes the numbering of markers, making the bottom left marker the first one.
@@ -58,7 +58,7 @@ rosrun aruco_pose genmap.py length x y dist_x dist_y first > ~/catkin_ws/src/clo
Usage example:
```bash
rosrun aruco_pose genmap.py 0.33 2 4 1 1 0 > ~/catkin_ws/src/clover/aruco_pose/map/test_map.txt
rosrun aruco_pose genmap.py 0.33 2 4 1 1 0 > ~/catkin_ws/src/clever/aruco_pose/map/test_map.txt
```
Additional information on the utility can be obtained using `-h` key: `rosrun aruco_pose genmap.py -h`.
@@ -91,6 +91,13 @@ The marker map adheres to the [ROS coordinate system convention](http://www.ros.
In order to enable vision position estimation you should use the following [PX4 parameters](px4_parameters.md).
If you're using **EKF2** estimator (`SYS_MC_EST_GROUP` parameter is set to `ekf2`), make sure the following is set:
* `EKF2_AID_MASK` should have `vision position fusion` and `vision yaw fusion` flags set.
* Vision angle observations noise: `EKF2_EVA_NOISE` = 0.1 rad.
* Vision position observations noise: `EKF2_EVP_NOISE` = 0.1 m.
* `EKF2_EV_DELAY` = 0.
If you're using **LPE** (`SYS_MC_EST_GROUP` parameter is set to `local_position_estimator,attitude_estimator_q`):
* `LPE_FUSION` should have `vision position` and `land detector` flags set. We suggest unsetting the `baro` flag for indoor flights.
@@ -101,13 +108,6 @@ If you're using **LPE** (`SYS_MC_EST_GROUP` parameter is set to `local_position_
<!-- * Compass should not be fused: `ATT_W_MAG` = 0 -->
If you're using **EKF2** estimator (`SYS_MC_EST_GROUP` parameter is set to `ekf2`), make sure the following is set:
* `EKF2_AID_MASK` should have `vision position fusion` and `vision yaw fusion` flags set.
* Vision angle observations noise: `EKF2_EVA_NOISE` = 0.1 rad.
* Vision position observations noise: `EKF2_EVP_NOISE` = 0.1 m.
* `EKF2_EV_DELAY` = 0.
> **Hint** We recommend using **LPE** for marker-based navigation.
You may use [the `selfcheck.py` utility](selfcheck.md) to check your settings.
@@ -152,7 +152,7 @@ If the drone's altitude is not stable, try increasing the `MPC_Z_VEL_P` paramete
In order to navigate using markers on the ceiling, mount the onboard camera so that it points up and [adjust the camera frame accordingly](camera_setup.md).
You should also set the `known_tilt` parameter to `map_flipped` in both `aruco_detect` and `aruco_map` sections of `~/catkin_ws/src/clover/clover/launch/aruco.launch`:
You should also set the `known_tilt` parameter to `map_flipped` in both `aruco_detect` and `aruco_map` sections of `~/catkin_ws/src/clever/clever/launch/aruco.launch`:
```xml
<param name="known_tilt" value="map_flipped"/>

View File

@@ -10,13 +10,13 @@ Using this module along with [map-based navigation](aruco_map.md) is also possib
## Setup
Set the `aruco` argument in `~/catkin_ws/src/clover/clover/launch/clover.launch` to `true`:
Set the `aruco` argument in `~/catkin_ws/src/clever/clever/launch/clever.launch` to `true`:
```xml
<arg name="aruco" default="true"/>
```
For enabling detection set the `aruco_detect` argument in `~/catkin_ws/src/clover/clover/launch/aruco.launch` to `true`:
For enabling detection set the `aruco_detect` argument in `~/catkin_ws/src/clever/clever/launch/aruco.launch` to `true`:
```xml
<arg name="aruco_detect" default="true"/>

View File

@@ -1,7 +1,5 @@
# Step-by-step guide on autonomous flight with Clover 4
> **Note** The following applies to [image version](image.md) **0.20** and up. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/auto_setup.md) for older images.
This manual contains links to other articles in which each of the topics addressed is discussed in more detail. If you encounter difficulties while reading one of these articles, it is recommended that you return to this manual, since many operations here are described step by step and some unnecessary steps are skipped.
## Raspberry Pi initial setup
@@ -57,10 +55,10 @@ Show list of files and folders:
ls
```
Go to certain directory by entering the path too it (catkin_ws/src/clover/clover/launch/):
Go to certain directory by entering the path too it (catkin_ws/src/clever/clever/launch/):
```bash
cd catkin_ws/src/clover/clover/launch/
cd catkin_ws/src/clever/clever/launch/
```
Go to home directory:
@@ -75,10 +73,10 @@ Open the file `file.py`:
nano file.py
```
Open the file clover.launch by entering the full path to it (it works even if you're in a different directory):
Open the file clever.launch by entering the full path to it (it works even if you're in a different directory):
```bash
nano ~/catkin_ws/src/clover/clover/launch/clover.launch
nano ~/catkin_ws/src/clever/clever/launch/clever.launch
```
Save file (press sequentially):
@@ -105,16 +103,16 @@ Raspberry Pi complete reboot:
sudo reboot
```
Reboot only the `clover` service:
Reboot only Clever package:
```bash
sudo systemctl restart clover
sudo systemctl restart clever
```
Perform selfcheck:
```bash
rosrun clover selfcheck.py
rosrun clever selfcheck.py
```
Stop a program:
@@ -129,10 +127,10 @@ Start a program `myprogram.py` using Python:
python myprogram.py
```
Journal of the events related to `clover` package. Scroll the list by pressing Enter or Ctrl+V (scrolls faster):
Journal of the events related to Clever package. Scroll the list by pressing Enter or Ctrl+V (scrolls faster):
```bash
journalctl -u clover
journalctl -u clever
```
Open the sudoers file with super user rights (this particular file doesn't open without sudo. You can use sudo to open other locked files or run programs that require super user rights):
@@ -143,45 +141,45 @@ sudo nano /etc/sudoers
## Setting Raspberry Pi for autonomous flight
Most of the parameters for autonomous flight are located in the following directory: `~/catkin_ws/src/clover/clover/launch/`.
Most of the parameters for autonomous flight are located in the following directory: `~/catkin_ws/src/clever/clever/launch/`.
- Enter the directory:
```bash
cd ~/catkin_ws/src/clover/clover/launch/
cd ~/catkin_ws/src/clever/clever/launch/
```
The `~` symbol stands for home directory of your user. If you are already in the directory, you can go with just the command:
```bash
cd catkin_ws/src/clover/clover/launch/
cd catkin_ws/src/clever/clever/launch/
```
> **Hint** Tab can automatically complete the names of files, folders or commands. You need to start entering the desired name and press Tab. If there are no conflicts, the name will be auto completed. For example, to quickly enter the path to the `catkin_ws/src/clover/clover/launch/` directory, after entering `cd`, you can start typing the following key combination:`c-Tab-s-Tab-c-Tab-c-Tab-l-Tab`. This way you can save a lot of time when writing a long command, and also avoid possible mistakes in writing the path.
> **Hint** Tab can automatically complete the names of files, folders or commands. You need to start entering the desired name and press Tab. If there are no conflicts, the name will be auto completed. For example, to quickly enter the path to the `catkin_ws/src/clever/clever/launch/` directory, after entering `cd`, you can start typing the following key combination:`c-Tab-s-Tab-c-Tab-c-Tab-l-Tab`. This way you can save a lot of time when writing a long command, and also avoid possible mistakes in writing the path.
- In this folder you need to configure three files:
- `clover.launch`
- `clever.launch`
- `aruco.launch`
- `main_camera.launch`
- Open the file `clover.launch`:
- Open the file `clever.launch`:
```bash
nano clover.launch
nano clever.launch
```
You must be in the directory in which the file is located. If you are in other directory, you can open the file by writing the full path to it:
```bash
nano ~/catkin_ws/src/clover/clover/launch/clover.launch
nano ~/catkin_ws/src/clever/clever/launch/clever.launch
```
If two users are editing a file at the same time, or if previously the file was closed incorrectly, nano will not display the file contents, it will ask for permission to display the file. To grant permission, press Y.
  If the content of a file is still empty, you may have entered the file name incorrectly. You need to pay attention to the extension. If you entered a wrong name or extension, nano will create a new empty file named this way, which is undesirable. Such file should be deleted.
- Find the following line in clover.launch file:
- Find the following line in clever.launch file:
```xml
<arg name="aruco" default="false"/>
@@ -224,7 +222,7 @@ Most of the parameters for autonomous flight are located in the following direct
- the marker map numbering is from the top left corner (key `--top-left`)
```bash
rosrun aruco_pose genmap.py 0.335 10 10 1 1 0 > ~/catkin_ws/src/clover/aruco_pose/map/map.txt --top-left
rosrun aruco_pose genmap.py 0.335 10 10 1 1 0 > ~/catkin_ws/src/clever/aruco_pose/map/map.txt --top-left
```
In most maps, numbering starts with a zero marker. Also, in most cases, numbering starts from the upper left corner, so when generating, it is very important to enter the key `--top-left`.
@@ -271,10 +269,10 @@ and replace map.txt with your map name.
Ctrl+x; y; Enter
```
- Restart the `clover` service:
- Restart the `clever` service:
```bash
sudo systemctl restart clover
sudo systemctl restart clever
```
## Setting the flight controller
@@ -306,7 +304,7 @@ Perform selfcheck when you have set up your drone or when you have faced problem
- Run the command:
```bash
rosrun clover selfcheck.py
rosrun clever selfcheck.py
```
## Writing a program
@@ -370,7 +368,7 @@ The article "[Simple OFFBOARD](simple_offboard.md)" describes working with `simp
## Writing the program to the drone
The easiest way to send the program is to copy the content of the program, create a new file in the command line and paste the program text into the file.
The easiest way to send the program is to copy the content of the program, create a new file on the Clever command line and paste the program text into the file.
- To create the file `myprogram.py`, run the command:

View File

@@ -1,38 +1,36 @@
Software autorun
===
> **Note** In the image version **0.20** `clever` package and service was renamed to `clover`. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/autolaunch.md) for older images.
systemd
---
Main documentation: [https://wiki.archlinux.org/index.php/Systemd_(Russian)](https://wiki.archlinux.org/index.php/Systemd_(Russian)).
All automatically started Clover software is launched as a `clover.service` systemd service.
All automatically started Clover software is launched as a `clever.service` systemd service.
The service may be restarted by the `systemctl` command:
```(bash)
sudo systemctl restart clover
sudo systemctl restart clever
```
Text output of the software can be viewed using the `journalctl` command:
```(bash)
journalctl -u clover
journalctl -u clever
```
To run Clover software directly in the current console session, you can use the `roslaunch` command:
```(bash)
sudo systemctl restart clover
roslaunch clover clover.launch
sudo systemctl restart clever
roslaunch clever clever.launch
```
You can disable Clover software autolaunch using the `disable` command:
```(bash)
sudo systemctl disable clover
sudo systemctl disable clever
```
roslaunch
@@ -40,12 +38,12 @@ roslaunch
Main documentation: http://wiki.ros.org/roslaunch.
The list of nodes / programs declared for running is specified in file `/home/pi/catkin_ws/src/clover/clover/launch/clover.launch`.
The list of nodes / programs declared for running is specified in file `/home/pi/catkin_ws/src/clever/clever/launch/clever.launch`.
You can add your own node to the list of automatically launched ones. To do this, place your executable file (e.g. `my_program.py`) into folder `/home/pi/catkin_ws/src/clover/clover/src`. Then add the start of your node to `clover.launch`, for example:
You can add your own node to the list of automatically launched ones. To do this, place your executable file (e.g. `my_program.py`) into folder `/home/pi/catkin_ws/src/clever/clever/src`. Then add the start of your node to `clever.launch`, for example:
```xml
<node name="my_program" pkg="clover" type="my_program.py" output="screen"/>
<node name="my_program" pkg="clever" type="my_program.py" output="screen"/>
```
The started file must have *permission* to run:

View File

@@ -1,8 +1,6 @@
# Working with the camera
> **Note** In the image version **0.20** `clever` package was renamed to `clover`. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/camera.md) for older images.
Make sure the camera is enabled in the `~/catkin_ws/src/clover/clover/launch/clover.launch` file:
Make sure the camera is enabled in the `~/catkin_ws/src/clever/clever/launch/clever.launch` file:
```xml
<arg name="main_camera" default="true"/>
@@ -10,10 +8,10 @@ Make sure the camera is enabled in the `~/catkin_ws/src/clover/clover/launch/clo
Also make sure that [position and orientation of the camera](camera_setup.md) is correct.
The `clover` service must be restarted after the launch-file has been edited:
The `clever` package must be restarted after the launch-file has been edited:
```(bash)
sudo systemctl restart clover
sudo systemctl restart clever
```
You may use rqt or [web_video_server](web_video_server.md) to view the camera stream.
@@ -22,10 +20,10 @@ You may use rqt or [web_video_server](web_video_server.md) to view the camera st
If the camera stream is missing, try using the [`raspistill`](https://www.raspberrypi.org/documentation/usage/camera/raspicam/raspistill.md) utility to check whether the camera works.
First, stop the `clover` service:
First, stop the Clever service:
```bash
sudo systemctl stop clover
sudo systemctl stop clever
```
Then use `raspistill` to capture an image from the camera:

View File

@@ -42,4 +42,4 @@ In order to calibrate the camera with the `camera_calibration` ROS-package you n
When the calculation is done, you'll see calculated parameters in the terminal. The corrected camera image view will be displayed as well. If calibration was successful all straight lines will remain straight on the image displayed.
7. Click the *COMMIT* button to store calculated calibration parameters. The result will be stored in the main Clover camera calibration file: `/home/pi/catkin_ws/src/clover/clover/camera_info/fisheye_cam_320.yaml`.
7. Click the *COMMIT* button to store calculated calibration parameters. The result will be stored in the main Clover camera calibration file: `/home/pi/catkin_ws/src/clever/clever/camera_info/fisheye_cam_320.yaml`.

View File

@@ -15,7 +15,7 @@ ls
Change current (working) directory:
```bash
cd catkin_ws/src/clover/clover/launch
cd catkin_ws/src/clever/clever/launch
```
Go one directory level up:
@@ -65,16 +65,16 @@ You can use **nano** to edit files on the Raspberry Pi. It is one of the more us
For example:
```bash
nano ~/catkin_ws/src/clover/clover/launch/clover.launch
nano ~/catkin_ws/src/clever/clever/launch/clever.launch
```
<img src="../assets/nano.png" alt="Editing files in nano" data-action="zoom">
2. Edit the file.
3. Press `Ctrl`+`X`, `Y`, `Enter` to save your file and exit.
4. Restart the `clover` service if you've changed .launch files:
4. Restart the `clever` package if you've changed .launch files:
```bash
sudo systemctl restart clover
sudo systemctl restart clever
```
You may also use other editors like **vim** if you prefer.

View File

@@ -20,24 +20,22 @@ USB connection is the preferred way to connect to the flight controller.
## UART connection
> **Note** In the image version **0.20** `clever` package and service was renamed to `clover`. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/connection.md) for older images.
<!-- TODO: Connection scheme -->
UART connection is another way for the Raspberry Pi and FCU to communicate.
1. Connect Raspberry Pi to your FCU using a UART cable.
2. [Connect to the Raspberry Pi over SSH](ssh.md).
3. Change the connection type in `~/catkin_ws/src/clover/clover/launch/clover.launch` to UART:
3. Change the connection type in `~/catkin_ws/src/clever/clever/launch/clever.launch` to UART:
```xml
<arg name="fcu_conn" default="uart"/>
```
Be sure to restart the `clover` service after editing the .launch file:
Be sure to restart the `clever` service after editing the .launch file:
```bash
sudo systemctl restart clover
sudo systemctl restart clever
```
> **Hint** Set the `SYS_COMPANION` PX4 parameter to 921600 to enable UART on the FCU.

View File

@@ -6,7 +6,7 @@ Pixhawk or Pixracer firmware may be flashed using QGroundControl or command line
Modified firmware for Clover
---
It is advisable to use a specialized build of PX4 with the necessary fixes and better defaults for the Clover drone. Use the latest stable release in our [GitHub repository](https://github.com/CopterExpress/Firmware/releases) with the word `clover`, for example, `v1.8.2-clover.5`.
It is advisable to use a specialized build of PX4 with the necessary fixes and better defaults for the Clover drone. Use the latest stable release in our [GitHub repository](https://github.com/CopterExpress/Firmware/releases) with the word `clever`, for example, `v1.8.2-clever.5`.
<div id="release" style="display:none">
<p>Latest stable release: <strong><a id="download-latest-release"></a></strong>.</p>
@@ -25,8 +25,8 @@ It is advisable to use a specialized build of PX4 with the necessary fixes and b
// look for stable release
let stable;
for (let release of data) {
let clover = (release.name.indexOf('clover') != -1) || (release.name.indexOf('clever') != -1);
if (clover && !release.prerelease && !release.draft) {
let clever = release.name.indexOf('clever') != -1;
if (clever && !release.prerelease && !release.draft) {
stable = release;
break;
}

View File

@@ -3,7 +3,7 @@ Coordinate systems (frames)
![TF2 Clover frames](../assets/frames.png)
Main frames in the `clover` package:
Main frames in the `clever` package:
* `map` has its origin at the flight controller initialization point and may be considered stationary. It is shown as a white grid on the image above;
* `base_link` is rigidly bound to the drone. It is shown by the simplified drone model on the image above;

View File

@@ -4,14 +4,14 @@ Using QGroundControl via Wi-Fi
![QGroundControl](../assets/qground.png)
You can monitor, control, calibrate and configure the flight controller of the quadcopter using QGroundControl via Wi-Fi.
This requires [connecting to Wi-Fi](wifi.md) of the `clover-xxxx` network.
This requires [connecting to Wi-Fi](wifi.md) of the `CLEVER-xxxx` network.
After that, in the Clover launch-file `/home/pi/catkin_ws/src/clover/clover/launch/clover.launch`, choose one of the preconfigured bridge modes.
After that, in the Clover launch-file `/home/pi/catkin_ws/src/clever/clever/launch/clever.launch`, choose one of the preconfigured bridge modes.
After editing the launch-file, restart the `clover` service:
After editing the launch-file, restart the clever service:
```(bash)
sudo systemctl restart clover
sudo systemctl restart clever
```
TCP bridge
@@ -27,7 +27,7 @@ Then in the QGroundControl program, choose Application Settings > Comm Links > A
![QGroundControl TCP connection](../assets/bridge_tcp.png)
Then choose the created connection from the list of connections, and click "Connect".
Then choose "Clover" from the list of connections, and click "Connect".
UDP bridge (with automated connection)
---
@@ -53,7 +53,7 @@ Then in the QGroundControl program, choose Application Settings > Comm Links > A
![QGroundControl UDP connection](../assets/bridge_udp.png)
Then choose the created connection from the list of connections, and click "Connect".
Then choose "CLEVER" from the list of connections, and click "Connect".
UDP broadcast bridge
---

View File

@@ -1,13 +1,11 @@
# Hostname
> **Note** The following applies to [image version](image.md) **0.20** and up. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/hostname.md) for older images.
[By default](image.md) the hostname of the Clover drone is set to `clever-xxxx`, where `xxxx` are random numbers. These numbers are the same as in the [Wi-Fi SSID](wifi.md).
[By default](image.md) the hostname of the Clover drone is set to `clover-xxxx`, where `xxxx` are random numbers. These numbers are the same as in the [Wi-Fi SSID](wifi.md).
Thus, Clover is accessible on machines that support mDNS as `clover-xxxx.local`. You can use this name to access Clover over SSH:
Thus, Clover is accessible on machines that support mDNS as `clever-xxxx.local`. You can use this name to access Clover over SSH:
```bash
ssh pi@clover-xxxx.local
ssh pi@clever-xxxx.local
```
Also, this name can be used in place of IP-address to open Clover web pages in browser, accessing ROS master, etc.

View File

@@ -1,54 +0,0 @@
# Work with ROS from browser
Using the [`roslibjs`](http://wiki.ros.org/roslibjs) library it's possible to work with all the ROS resources (topics, services, parameters) from JavaScript code within the browser, which allows creating various interactive web applications for drone.
All the required software is preinstalled in [RPi image](image.md) for Clover.
## Example
An example of a web page, working with `roslib.js`:
```html
<html>
<script src="js/roslib.js"></script>
<script type="text/javascript">
// Establish roslibjs connection
var ros = new ROSLIB.Ros({ url: 'ws://' + location.hostname + ':9090' });
ros.on('connection', function () {
// Connection callback
alert('Connected');
});
// Declare get_telemetry service client
var getTelemetry = new ROSLIB.Service({ ros: ros, name : '/get_telemetry', serviceType : 'clover/GetTelemetry' });
// Call get_telemetry
getTelemetry.callService(new ROSLIB.ServiceRequest({ frame_id: 'map' }), function(result) {
// Service respond callback
alert('Telemetry: ' + JSON.stringify(result));
});
// Subscribe to `/mavros/state` topic
var stateSub = new ROSLIB.Topic({ ros : ros, name : '/mavros/state', messageType : 'mavros_msgs/State' });
stateSub.subscribe(function(msg) {
// Topic message callback
console.log('State: ', msg);
});
</script>
</html>
```
[Taking off, landing and all the rest operations](programming.md) can be implemented in a similar way.
The page should be placed in the `/home/pi/catkin_ws/src/clover/clover/www/` directory. After that, it will be available at `http://192.168.11.1/<page_name>.html`. When the page is opened, browser should show an alert with the drone telemetry and constantly print the state of the flight controller to the console.
<img src="../assets/js-ros.png" class="center zoom"/>
See additional information in [`roslibjs` tutorial](http://wiki.ros.org/roslibjs/Tutorials/BasicRosFunctionality).
## Web GCS
See an example of simplified web ground control station on Clover at http://192.168.11.1/gcs.html.
<img src="../assets/web-gcs.png" class="center zoom"/>

View File

@@ -124,10 +124,10 @@ source devel/setup.bash
Configure the launch files to your taste and use `roslaunch` to launch the nodes:
```bash
roslaunch clover clover.launch
roslaunch clever clever.launch
```
> **Hint** You may want to start the Clover nodes automatically. This can be done with `systemd`: look at service files for [`roscore`](https://github.com/CopterExpress/clover/blob/master/builder/assets/roscore.service) and [`clover`](https://github.com/CopterExpress/clover/blob/master/builder/assets/clover.service) that are used in our image and adjust them as necessary.
> **Hint** You may want to start the Clover nodes automatically. This can be done with `systemd`: look at service files for [`roscore`](https://github.com/CopterExpress/clover/blob/master/builder/assets/roscore.service) and [`clever`](https://github.com/CopterExpress/clover/blob/master/builder/assets/clever.service) that are used in our image and adjust them as necessary.
## Caveats

View File

@@ -1,6 +1,6 @@
# Working with a laser rangefinder
> **Note** Documentation for the [image](image.md), versions, starting with **0.20**. For older versions refer to [documentation for version **0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/laser.md).
> **Note** Documentation for the [image](image.md), versions, starting with **0.18**. For older versions refer to [documentation for version **0.17**](https://github.com/CopterExpress/clover/blob/v0.17/docs/en/laser.md).
## VL53L1X Rangefinder
@@ -10,7 +10,18 @@ The [image for Raspberry Pi](image.md) contains pre-installed corresponding ROS
### Connecting to Raspberry Pi
> **Hint** We recommend using our [custom PX4 firmware for Clover](firmware.md#modified-firmware-for-clover) for best laser rangefinder support.
> **Note** You need to flash a <a id="download-firmware" href="https://github.com/CopterExpress/Firmware/releases">custom PX4 firmware</a> on your flight controller for the rangefinder to work correctly. See more about firmware in the [corresponding article](firmware.md).
<script type="text/javascript">
fetch('https://api.github.com/repos/CopterExpress/Firmware/releases').then(res => res.json()).then(function(data) {
for (let release of data) {
if (!release.prerelease && !release.draft && release.tag_name.includes('-clever.')) {
document.querySelector('#download-firmware').href = release.html_url;
return;
}
}
});
</script>
Connect the rangefinder to the 3V, GND, SCL and SDA pins via the I²C interface:
@@ -22,7 +33,7 @@ If the pin marked GND is occupied, you can use any other ground pin (look at the
### Enabling the rangefinder
[Connect via SSH](ssh.md) and edit file `~/catkin_ws/src/clover/clover/launch/clover.launch` so that the VL53L1X driver is enabled:
[Connect via SSH](ssh.md) and edit file `~/catkin_ws/src/clever/clever/launch/clever.launch` so that the VL53L1X driver is enabled:
```xml
<arg name="rangefinder_vl53l1x" default="true"/>

View File

@@ -1,6 +1,6 @@
# Working with a LED strip
> **Note** Documentation for the [image](image.md) versions, starting with **0.20**. For older versions refer to [documentation for version **0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/leds.md).
> **Note** The following applies to image version 0.18 and up. See [previous version of the article](leds_old.md) for older images.
Clover drone kits contain addressable LED strips based on *ws281x* drivers. Each LED may be set to any one of 16 million possible colors (each color is encoded by a 24-bit number). This allows making the Clover flight more spectacular, as well as show flight modes, display stages of current user program, and notify the pilot of other events.
@@ -17,13 +17,13 @@ Our [Raspberry Pi image](image.md) contains preinstalled modules for interfacing
## High-level control
1. Connect the +5v and GND leads of your LED to a power source and the DIN (data in) lead to GPIO21. Consult the [assembly instructions](assemble_4.md#Connecting-the-LED-strip-to-Raspberry-Pi) for details.
2. Enable LED strip support in `~/catkin_ws/src/clover/clover/launch/clover.launch`:
2. Enable LED strip support in `~/catkin_ws/src/clever/clever/launch/clever.launch`:
```xml
<arg name="led" default="true"/>
```
3. Configure the *ws281x* parameters in `~/catkin_ws/src/clover/clover/launch/led.launch`. Change the number of addressable LEDs and the GPIO pin used for control to match your configuration:
3. Configure the *ws281x* parameters in `~/catkin_ws/src/clever/clever/launch/led.launch`. Change the number of addressable LEDs and the GPIO pin used for control to match your configuration:
```xml
<param name="led_count" value="30"/> <!-- Number of LEDs in the strip -->
@@ -50,7 +50,7 @@ Python example:
```python
import rospy
from clover.srv import SetLEDEffect
from clever.srv import SetLEDEffect
# ...
@@ -88,7 +88,7 @@ rosservice call /led/set_effect "{effect: 'rainbow'}"
## Configuring event visualizations
It is possible to display current flight controller status and notify the user about some events with the LED strip. This is configured in the `~/catkin_ws/src/clover/clover/launch/led.launch` file in the *events effects table* section. Here is a sample configuration:
It is possible to display current flight controller status and notify the user about some events with the LED strip. This is configured in the `~/catkin_ws/src/clever/clever/launch/led.launch` file in the *events effects table* section. Here is a sample configuration:
```xml
startup: { r: 255, g: 255, b: 255 }
@@ -110,7 +110,7 @@ The left part is one of the possible events that the strip reacts to. The right
> **Note** You need to [calibrate the power sensor](power.md#calibrating-the-power-sensor) for the `low_battery` event to work properly.
In order to disable LED strip notifications set `led_notify` argument in `~/catkin_ws/src/clover/clover/launch/led.launch` to `false`:
In order to disable LED strip notifications set `led_notify` argument in `~/catkin_ws/src/clever/clever/launch/led.launch` to `false`:
```xml
<arg name="led_notify" default="false"/>

View File

@@ -12,7 +12,7 @@ The MAVROS node is automatically started in the Clover launch-file. In order to
<!-- -->
> **Note** Some MAVROS plugins are disabled by default in the `clover` package in order to save resources. For more information, see the `plugin_blacklist` parameter in `/home/pi/catkin_ws/src/clover/clover/launch/mavros.launch`.
> **Note** Some MAVROS plugins are disabled by default in the `clever` package in order to save resources. For more information, see the `plugin_blacklist` parameter in `/home/pi/catkin_ws/src/clever/clever/launch/mavros.launch`.
## Main services

View File

@@ -20,7 +20,7 @@ On our [RPi image](image.md) the Wi-Fi adapter is configured to use the [access
```txt
network={
ssid="my-super-ssid"
psk="cloverwifi123"
psk="cleverwifi123"
mode=2
proto=RSN
key_mgmt=WPA-PSK
@@ -90,8 +90,8 @@ On our [RPi image](image.md) the Wi-Fi adapter is configured to use the [access
country=GB
network={
ssid="clover-1234"
psk="cloverwifi"
ssid="CLEVER-1234"
psk="cleverwifi"
mode=2
proto=RSN
key_mgmt=WPA-PSK
@@ -101,7 +101,7 @@ On our [RPi image](image.md) the Wi-Fi adapter is configured to use the [access
}
```
where `clover-1234` is the network name and `cloverwifi` is the password.
where `CLEVER-1234` is the network name and `cleverwifi` is the password.
3. Enable the `dnsmasq` service.
@@ -155,8 +155,8 @@ update_config=1
country=GB
network={
ssid=\"my-clover\"
psk=\"cloverwifi\"
ssid=\"CLEVER-SMIRNOV\"
psk=\"cleverwifi\"
mode=2
proto=RSN
key_mgmt=WPA-PSK
@@ -212,7 +212,7 @@ sudo apt install dnsmasq-base
```bash
# Calling dnsmasq-base
sudo dnsmasq --interface=wlan0 --address=/clover/coex/192.168.11.1 --no-daemon --dhcp-range=192.168.11.100,192.168.11.200,12h --no-hosts --filterwin2k --bogus-priv --domain-needed --quiet-dhcp6 --log-queries
sudo dnsmasq --interface=wlan0 --address=/clever/coex/192.168.11.1 --no-daemon --dhcp-range=192.168.11.100,192.168.11.200,12h --no-hosts --filterwin2k --bogus-priv --domain-needed --quiet-dhcp6 --log-queries
# More about dnsmasq-base
dnsmasq --help
@@ -230,7 +230,7 @@ sudo apt install dnsmasq
```bash
cat << EOF | sudo tee -a /etc/dnsmasq.conf
interface=wlan0
address=/clover/coex/192.168.11.1
address=/clever/coex/192.168.11.1
dhcp-range=192.168.11.100,192.168.11.200,12h
no-hosts
filterwin2k

View File

@@ -8,7 +8,7 @@ Running the technology "Optical Flow" offers the possibility of POSCTL flight mo
The use of a rangefinder is essential. [Connect and setup laser-ranging sensor VL53L1X](laser.md), according to the manual.
Enable Optical Flow in the file `~/catkin_ws/src/clover/clover/launch/clover.launch`:
Enable Optical Flow in the file `~/catkin_ws/src/clever/clever/launch/clever.launch`:
```xml
<arg name="optical_flow" default="true"/>
@@ -20,7 +20,7 @@ Optical Flow publishes data in `mavros/px4flow/raw/send` topic. In the topic `op
## Setup of the flight controller
> **Hint** Suggested parameters are applied automatically in [our custom PX4 firmware](firmware.md#modified-firmware-for-clover).
> **Hint** Suggested parameters are applied automatically in [our custom PX4 firmware](firmware.md#modified-firmware-for-clever).
When using **EKF2** (parameter `SYS_MC_EST_GROUP` = `ekf2`):

View File

@@ -4,7 +4,7 @@
The Clover platform allows a [Raspberry Pi](raspberry.md) computer to be used for programming autonomous flights. The flight program is typically written using the Python programming language. The program may [receive telemetry data](simple_offboard.md#get_telemetry) (which includes battery data, attitude, position, and other parameters) and send commands like: [fly to a point in space](simple_offboard.md#navigate), [set attitude](simple_offboard.md#set_attitude), [set angular rates](simple_offboard.md#set_rates), and others.
The platform utilizes the [ROS framework](ros.md), which allows the user program to communicate with the Clover services that are running as a `clover` systemd daemon. The [MAVROS](mavros.md) package is used to interact with the flight controller.
The platform utilizes the [ROS framework](ros.md), which allows the user program to communicate with the Clover services that are running as a `clever` systemd daemon. The [MAVROS](mavros.md) package is used to interact with the flight controller.
PX4 uses [OFFBOARD mode](modes.md#auto) for autonomous flights. The Clover API can be used to transition the drone to this flight mode automatically. If you need to interrupt the autonomous flight, use your flight mode stick on your RC controller to transition to any other flight mode.
@@ -44,7 +44,7 @@ Below is a complete flight program that performs a takeoff, flies forward and la
#coding: utf8
import rospy
from clover import srv
from clever import srv
from std_srvs.srv import Trigger
rospy.init_node('flight')

View File

@@ -16,7 +16,7 @@ Configuring
> **Warning** An open QGroundControl or rviz connection sends large amounts of data over Wi-Fi, which can adversely affect responsiveness of the mobile transmitter. It is recommended not to use these applications together with it.
Install [Clover image on RPi](image.md). For running the application, settings `rosbridge` and `rc` in the launch file (`~/catkin_ws/src/clover/clover/launch/clover.launch`) should be enabled:
Install [Clover image on RPi](image.md). For running the application, settings `rosbridge` and `rc` in the launch file (`~/catkin_ws/src/clever/clever/launch/clever.launch`) should be enabled:
```xml
<arg name="rosbridge" default="true"/>
@@ -26,10 +26,10 @@ Install [Clover image on RPi](image.md). For running the application, settings `
<arg name="rc" default="true"/>
```
After the launch-file is edited, restart package `clover`:
After the launch-file is edited, restart package `clever`:
```bash
sudo systemctl restart clover
```(bash)
sudo systemctl restart clever
```
Also make sure that PX4-parameter `COM_RC_IN_MODE` is set to `0` (RC Transmitter).
@@ -44,7 +44,7 @@ Additional PX4 parameters:
Connection
---
Connect the smartphone to Clover [Wi-Fi](wifi.md) network (`clover-xxxx`). The application should connect to the copter automatically. Upon successful connection, the current [mode](modes.md) and the battery charge level should be displayed.
Connect the smartphone to Clover [Wi-Fi](wifi.md) network (`CLEVER-xxxx`). The application should connect to the copter automatically. Upon successful connection, the current [mode](modes.md) and the battery charge level should be displayed.
The sticks on the screen of the application work just like real sticks. To arm the copter, hold the left stick in the bottom right corner for several seconds. To disarm — in the bottom left corner.

View File

@@ -1,107 +0,0 @@
# Using Flysky FS-A8S
The Flysky FS-A8S receiver is compatible with the Flysky FS-i6 and FS-i6x transmitters. The receiver can output both analog PPM and digital S.Bus/i-Bus signals to the flight controller.
S.Bus is the preferred protocol for the receiver.
## Making a cable
> **Note** You don't need to follow these steps if you already have the right cable; read on to learn [how to bind your transmitter](#rc_bind).
1. Gently remove the yellow wire from the receiver connector. Use sharp tweezers to lift up the plastic wire lock:
<div class="image-group">
<img src="../assets/flysky_a8s/01_remove_cable_fs.png" width=300 class="zoom border" alt="a8s wire removal 1">
<img src="../assets/flysky_a8s/02_remove_cable_fs.png" width=300 class="zoom border" alt="a8s wire removal 2">
</div>
2. [Pixracer only] Remove the green and brown wires from the 5-pin connector:
<div class="image-group">
<img src="../assets/flysky_a8s/03_remove_cable_pixracer.png" width=300 class="zoom border" alt="pixracer wire removal 1">
<img src="../assets/flysky_a8s/04_remove_cable_pixracer.png" width=300 class="zoom border" alt="pixracer wire removal 2">
</div>
3. [COEX Pix only] Remove the green wire (or blue if the green one is not present) from the 4-pin connector:
<div class="image-group">
<img src="../assets/flysky_a8s/05_remove_cable_coexpix.png" width=300 class="zoom border" alt="coexpix wire removal 1">
<img src="../assets/flysky_a8s/06_remove_cable_coexpix.png" width=300 class="zoom border" alt="coexpix wire removal 2">
</div>
4. Use side cutters to cut the Dupont connectors:
<div class="image-group">
<img src="../assets/flysky_a8s/07_wirecuts_1.png" width=300 class="zoom border" alt="wire cutting">
<img src="../assets/flysky_a8s/08_wirecuts_2.png" width=300 class="zoom border" alt="wire cuts">
</div>
5. Strip and tin 5-7 mm of wire from each side:
<img src="../assets/flysky_a8s/09_wirecuts_stripped.png" width=300 class="zoom border center" alt="tinning prep">
6. Put heat shrinking tubes on the wires:
<img src="../assets/flysky_a8s/10_heatshrink.png" width=300 class="zoom border center" alt="shrink tubing">
7. Solder the following wires:
* black wire from the receiver connector to the black wire from the flight controller connector;
* red wire from the receiver connector to the red wire from the flight controller connector;
* white wire from the receiver connector to the white (if you're using Pixracer) or yellow (if you're using COEX Pix) wire from the flight controller connector:
<img src="../assets/flysky_a8s/11_solder_scheme.png" width=300 class="zoom border center" alt="wire soldering">
8. Put the heat shrinking tubes on the solder joints and heat them:
<img src="../assets/flysky_a8s/12_heatshrink_heat.png" width=300 class="zoom border center" alt="shrink tube heating">
9. Twist your new cable:
<img src="../assets/flysky_a8s/13_cable_twist.png" width=300 class="zoom border center" alt="twisted cables">
Connect your receiver to the RC IN port on your flight controller:
<div class="image-group">
<img src="../assets/flysky_a8s/14_pixracer_rcin.png" width=300 class="zoom border center" alt="pixracer connection">
<img src="../assets/flysky_a8s/14_coexpix_rcin.png" width=300 class="zoom border center" alt="coex pix connection">
</div>
> **Hint** Double check that you're using the RC IN port on the COEX Pix:
<img src="../assets/coexpix-bottom.jpg" width=300 class="zoom border center" alt="coex pix pinout">
## Binding your transmitter {#rc_bind}
Do the following to bind your transmitter to the FS-A8S receiver:
1. Make sure your flight controller is powered off.
2. Hold the **BIND** button on the receiver:
<img src="../assets/flysky_a8s/15_bind_key.png" width=300 class="zoom border center" alt="bind key">
3. Turn on the flight controller. The LED light on the receiver should blink fast, about 3 times per second.
<img src="../assets/flysky_a8s/16_blink_fast.gif" width=300 class="zoom border center" alt="fast blink">
4. Hold the **BIND KEY** on your transmitter and power it on. You should see a message saying **RX Binding...**
<img src="../assets/flysky_a8s/17_controller_rxbind.png" width=300 class="zoom border center" alt="rx binding">
5. The LED light on the receiver should start blinking slowly, about once per second.
<img src="../assets/flysky_a8s/16_blink_slow.gif" width=300 class="zoom border center" alt="slow blink">
6. Turn your transmitter off and on again. The LED light on the receiver should glow steadily.
<img src="../assets/flysky_a8s/16_bind_indicator.png" width=300 class="zoom border center" alt="steady glow">
> **Note** This receiver does not send any telemetry data back to the transmitter. Your transmitter will not display any data like RSSI and drone battery level on its screen. In fact, there will be no indication that the transmitter is connected to the receiver. This is not a malfunction, the controls will still work.
## Changing the receiver mode (S.Bus/i-Bus)
Connect your flight controller to your computer and open QGroundControl. In it, open the Radio tab:
![qgc radio pane](../assets/flysky_a8s/18_qgc_radio.png)
If it shows zero channels under the transmitter image, hold the **BIND** key on the receiver for 2 seconds. You should then see 18 channels appear under the image:
![qgc radio with channels](../assets/flysky_a8s/19_qgc_channels.png)

View File

@@ -1,25 +0,0 @@
# Robocross-2019
On July, 2019, for the fourth time in a row, the team Copter Express won the annual tests of unmanned vehicles "[Robocross](http://russianrobotics.ru/activities/robokross-2019/)". Tests are held at the GAZ test site near Nizhny Novgorod.
The main objective of the tests in the UAV category was to localize and destroy the target - the red balloon - autonomously.
## Video
<iframe width="560" height="315" src="https://www.youtube.com/embed/zMh5THdHuX8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
## Implementation
The team used an F450 frame based quadcopter and [Clover software platform](https://github.com/CopterExpress/clover). The final source code is available [on GitHub](https://github.com/CopterExpress/robocross2019/).
`robocross2019` ROS package is divided into two parts: `red_dead_detection` ROS nodelet recognizes the red ball, `ball.py` implements high-level flight logic.
## red_dead_detection
The `red_dead_detection` nodelet recognizes the red ball on the image from the forward looking quadcopter camera (`/front_camera/image_raw` and `/front_camera/camera_info` topics). The simplest method of filtering the image by color is applied. Then the nodelet calculates the geometric center of the detected segments, and performs camera distortion compensation (`cv::undistortPoints`).
Using the known focal lengths of the camera (from `camera_info`), the nodelet calculates the vector directed towards the target. The resulting vector is published to the topic `/red_dead_detection/direction`; its coordinate system (`frame_id` is associated with the front camera `front_camera_optical`).
## balloon.py
To fly towards the ball, the direction vector `red_dead_detection/direction` is used, which is set as a setpoint for the velocity of the drone. The yaw angle is also set towards the ball. The target is considered destroyed when the total area of red pixels is less than the threshold for a certain amount of camera frames.

View File

@@ -84,11 +84,11 @@ A service can be assimilated to the a function that can be called from one node,
An example ROS service invoking from Python:
```python
from clover.srv import GetTelemetry
from clever.srv import GetTelemetry
# ...
# Creating a wrapper for the get_telemetry service of the clover package with the GetTelemetry type:
# Creating a wrapper for the get_telemetry service of the clever package with the GetTelemetry type:
get_telemetry = rospy.ServiceProxy('get_telemetry', srv.GetTelemetry)
# Invoking the service, and receiving the quadcopter telemetry:

View File

@@ -14,7 +14,7 @@ Install package `ros-melodic-desktop-full` or `ros-melodic-desktop` using the [i
Start rviz
---
To start еру visualization of the state of Clover in real time, connect to it via Wi-Fi (`clover-xxx`) and run rviz, specifying an appropriate ROS_MASTER_URI:
To start еру visualization of the state of Clover in real time, connect to it via Wi-Fi (`CLEVER-xxx`) and run rviz, specifying an appropriate ROS_MASTER_URI:
```(bash)
ROS_MASTER_URI=http://192.168.11.1:11311 rviz

View File

@@ -7,7 +7,7 @@ It is generally a good idea to perform this check before flight, especially befo
In order to run it, enter the following command in [the Raspberry Pi console](ssh.md):
```(bash)
rosrun clover selfcheck.py
rosrun clever selfcheck.py
```
<img src="../assets/selfcheck.png">

View File

@@ -1,13 +1,13 @@
Simple OFFBOARD
===
> **Note** In the image version **0.20** `clever` package was renamed to `clover`. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/simple_offboard.md) for older images.
> **Note** The following applies to [image](image.md) versions **0.15** and up. Older documentation is still avaliable [for version **0.14**](https://github.com/CopterExpress/clover/blob/v0.14/docs/ru/simple_offboard.md) (Russian only).
<!-- -->
> **Hint** We recommend using our [custom PX4 firmware for Clover](firmware.md#modified-firmware-for-clover) for autonomous flights.
> **Hint** We recommend using our [special PX4 firmware for Clover](firmware.md#modified-firmware-for-clever) for autonomous flights.
The `simple_offboard` module of the `clover` package is intended for simplified programming of the autonomous drone flight (`OFFBOARD` [flight mode](modes.md)). It allows setting the desired flight tasks, and automatically transforms [coordinates between frames](frames.md).
The `simple_offboard` module of the `clever` package is intended for simplified programming of the autonomous drone flight (`OFFBOARD` [flight mode](modes.md)). It allows setting the desired flight tasks, and automatically transforms [coordinates between frames](frames.md).
`simple_offboard` is a high level system for interacting with the flight controller. For a more low level system, see [mavros](mavros.md).
@@ -20,7 +20,7 @@ You need to create proxies for services before calling them. Use the following t
```python
import rospy
from clover import srv
from clever import srv
from std_srvs.srv import Trigger
rospy.init_node('flight') # 'flight' is name of your ROS node

View File

@@ -361,7 +361,7 @@ rospy.loginfo('flip')
flip()
```
Requires the [special PX4 firmware for Clover](firmware.md#modified-firmware-for-clover). Before running a flip, take all necessary safty precautions.
Requires the [special PX4 firmware for Clover](firmware.md#modified-firmware-for-clever). Before running a flip, take all necessary safty precautions.
### # {#calibrate-gyro}

View File

@@ -69,7 +69,7 @@ sudo systemctl disable hciuart.service
## Default image configuration
In the [Clover image for RPi](image.md), we initially disabled Mini UART and the Bluetooth module.
In image CLEVER, we initially disabled Mini UART and the Bluetooth module.
Bugs
----

View File

@@ -1,12 +1,28 @@
# Viewing images from cameras
To view images from cameras (or other ROS topics), you can use [rviz](rviz.md), rqt, or watch them in a browser using web_video_server.
To view images from cameras (or other ROS topics), you can use [rviz](rviz.md), rqt, or watch them in a browser using web\_video\_server.
See read more about [using rqt](rviz.md).
## Viewing in a browser
To view a video-stream, you have to [connect to Wi-Fi network](wifi.md) of the Clover (`clover-xxxx`), navigate to page [http://192.168.11.1:8080/](http://192.168.11.1:8080/), and choose the topic.
### Configuration
Make sure that in Clover launch-file \(`~/catkin_ws/src/clever/clever/launch/clever.launch`\), starting `web_video_server` is enabled:
```xml
<arg name="web_video_server" default="true"/>
```
After the launch-file is edited, restart package `clever`:
```bash
sudo systemctl restart clever
```
### Viewing
To view a video-stream, you have to [connect to Wi-Fi](wifi.md) of Clover \(`CLEVER-xxxx`\), navigate to page [http://192.168.11.1:8080/](http://192.168.11.1:8080/), and choose the topic.
![Viewing web_video_server](../assets/web_video_server.png)

View File

@@ -1,11 +1,9 @@
Connecting to Clover via Wi-Fi
===
> **Note** The following applies to [image version](image.md) **0.20** and up. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/wifi.md) for older images.
[RPi image](image.md) provides a pre-configured Wi-Fi access point with SSID `CLEVER-xxxx`, where `xxxx` are four random numbers that are assigned when your Raspberry Pi is run for the first time.
[RPi image](image.md) provides a pre-configured Wi-Fi access point with SSID `clover-xxxx`, where `xxxx` are four random numbers that are assigned when your Raspberry Pi is run for the first time.
Connect to this Wi-Fi using the password `cloverwifi`.
Connect to this Wi-Fi using the password `cleverwifi`.
<img src="../assets/ssid.png" width="300px" alt="Wi-Fi SSID">
@@ -15,6 +13,6 @@ To edit Wi-Fi settings, or to obtain more detailed information about the network
After connecting to Clover Wi-Fi, open http://192.168.11.1 in you web browser. It contains all the basic web tools of Clover: viewing image topics, web terminal (Butterfly), and the full copy of this documentation.
<img src="../assets/web.png" alt="Clover Web Interface" class="zoom">
<img src="../assets/web.png" alt="Веб-интерфейс Клевера" class="zoom">
**Next**: [Connecting Raspberry Pi to the flight controller](connection.md).

View File

@@ -11,7 +11,6 @@
* [Первоначальная настройка](setup.md)
* [Калибровка датчиков](calibration.md)
* [Настройка пульта](radio.md)
* [Работа с FS-A8S](rc_flysky_a8s.md)
* [Полетные режимы](modes.md)
* [Настройка питания](power.md)
* [Настройка failsafe](failsafe.md)
@@ -43,7 +42,6 @@
* [Компьютерное зрение](camera.md)
* [Визуализация с помощью rviz](rviz.md)
* [Автозапуск ПО](autolaunch.md)
* [Использование JavaScript](javascript.md)
* [ROS](ros.md)
* [MAVROS](mavros.md)
* Дополнительные материалы

View File

@@ -18,7 +18,7 @@ rosrun rosserial_arduino make_libraries.py .
## Настройка Raspberry Pi
Для запуска `rosserial` создайте файл `arduino.launch` в каталоге `~/catkin_ws/src/clover/clover/launch/` со следующим содержимым:
Для запуска `rosserial` создайте файл `arduino.launch` в каталоге `~/catkin_ws/src/clever/clever/launch/` со следующим содержимым:
```xml
<launch>
@@ -31,19 +31,19 @@ rosrun rosserial_arduino make_libraries.py .
Чтобы единоразово запустить программу на Arduino, можно будет воспользоваться командой:
```bash
roslaunch clover arduino.launch
roslaunch clever arduino.launch
```
Чтобы запускать связку с Arduino при старте системы автоматически, необходимо добавить запуск созданного launch-файла в основной launch-файл Клевера (`~/catkin_ws/src/clover/clover/launch/clover.launch`). Добавьте в конец этого файла строку:
Чтобы запускать связку с Arduino при старте системы автоматически, необходимо добавить запуск созданного launch-файла в основной launch-файл Клевера (`~/catkin_ws/src/clever/clever/launch/clever.launch`). Добавьте в конец этого файла строку:
```xml
<include file="$(find clover)/launch/arduino.launch"/>
<include file="$(find clever)/launch/arduino.launch"/>
```
При изменении launch-файла необходимо перезапустить пакет `clover`:
При изменении launch-файла необходимо перезапустить пакет `clever`:
```bash
sudo systemctl restart clover
sudo systemctl restart clever
```
## Задержки
@@ -79,11 +79,11 @@ for(int i=0; i<8; i++) {
// Подключение библиотек для работы с rosseral
#include <ros.h>
// Подключение заголовочных файлов сообщений пакета clover и MAVROS
#include <clover/Navigate.h>
// Подключение заголовочных файлов сообщений пакета Clever и MAVROS
#include <clever/Navigate.h>
#include <mavros_msgs/SetMode.h>
using namespace clover;
using namespace clever;
using namespace mavros_msgs;
ros::NodeHandle nh;
@@ -184,7 +184,7 @@ void loop()
// ...
#include <clover/GetTelemetry.h>
#include <clever/GetTelemetry.h>
// ...

View File

@@ -10,13 +10,13 @@
## Конфигурирование
Аргумент `aruco` в файле `~/catkin_ws/src/clover/clover/launch/clover.launch` должен быть в значении `true`:
Аргумент `aruco` в файле `~/catkin_ws/src/clever/clever/launch/clever.launch` должен быть в значении `true`:
```xml
<arg name="aruco" default="true"/>
```
Для включения распознавания карт маркеров аргументы `aruco_map` и `aruco_detect` в файле `~/catkin_ws/src/clover/clover/launch/aruco.launch` должны быть в значении `true`:
Для включения распознавания карт маркеров аргументы `aruco_map` и `aruco_detect` в файле `~/catkin_ws/src/clever/clever/launch/aruco.launch` должны быть в значении `true`:
```xml
<arg name="aruco_detect" default="true"/>
@@ -45,12 +45,12 @@ id_маркера размераркера x y z угол_z угол_y уго
<param name="map" value="$(find aruco_pose)/map/map.txt"/>
```
Смотрите примеры карт маркеров в каталоге [`~/catkin_ws/src/clover/aruco_pose/map`](https://github.com/CopterExpress/clover/tree/master/aruco_pose/map).
Смотрите примеры карт маркеров в каталоге [`~/catkin_ws/src/clever/aruco_pose/map`](https://github.com/CopterExpress/clover/tree/master/aruco_pose/map).
Файл карты может быть сгенерирован с помощью инструмента `genmap.py`:
```bash
rosrun aruco_pose genmap.py length x y dist_x dist_y first > ~/catkin_ws/src/clover/aruco_pose/map/test_map.txt
rosrun aruco_pose genmap.py length x y dist_x dist_y first > ~/catkin_ws/src/clever/aruco_pose/map/test_map.txt
```
Где `length` размер маркера, `x` количество маркеров по оси *x*, `y` - количество маркеров по оси *y*, `dist_x` расстояние между центрами маркеров по оси *x*, `y` расстояние между центрами маркеров по оси *y*, `first` ID первого (левого нижнего) маркера, `test_map.txt` название файла с картой. Дополнительный ключ `--bottom-left` позволяет нумеровать маркеры с левого нижнего угла.
@@ -58,7 +58,7 @@ rosrun aruco_pose genmap.py length x y dist_x dist_y first > ~/catkin_ws/src/clo
Пример:
```bash
rosrun aruco_pose genmap.py 0.33 2 4 1 1 0 > ~/catkin_ws/src/clover/aruco_pose/map/test_map.txt
rosrun aruco_pose genmap.py 0.33 2 4 1 1 0 > ~/catkin_ws/src/clever/aruco_pose/map/test_map.txt
```
Дополнительную информацию по утилите можно получить по ключу `-h`: `rosrun aruco_pose genmap.py -h`.
@@ -91,23 +91,23 @@ rosrun aruco_pose genmap.py 0.33 2 4 1 1 0 > ~/catkin_ws/src/clover/aruco_pose/m
Для работы механизма Vision Position Estimation необходимы следующие [настройки PX4](px4_parameters.md).
При использовании **EKF2** (параметр `SYS_MC_EST_GROUP` = `ekf2`):
* В параметре `EKF2_AID_MASK` включены флажки `vision position fusion`, `vision yaw fusion`.
* Шум угла по зрению: `EKF2_EVA_NOISE` = 0.1 rad
* Шум позиции по зрению: `EKF2_EVP_NOISE` = 0.1 m
* `EKF2_EV_DELAY` = 0
При использовании **LPE** (параметр `SYS_MC_EST_GROUP` = `local_position_estimator, attitude_estimator_q`):
* В параметре `LPE_FUSION` включены флажки `vision position`, `land detector`. Флажок `baro` рекомендуется отключить.
* Вес угла по рысканью по зрению: `ATT_W_EXT_HDG` = 0.5
* Включена ориентация по Yaw по зрению: `ATT_EXT_HDG_M` = 1 `Vision`.
* Шумы позиции по зрению: `LPE_VIS_XY` = 0.1 m, `LPE_VIS_Z` = 0.1 m.
* `LPE_VIS_DELAY` = 0 sec.
* `LPE_VIS_DELAY` = 0 sec
<!-- * Выключен компас: `ATT_W_MAG` = 0 -->
При использовании **EKF2** (параметр `SYS_MC_EST_GROUP` = `ekf2`):
* В параметре `EKF2_AID_MASK` включены флажки `vision position fusion`, `vision yaw fusion`.
* Шум угла по зрению: `EKF2_EVA_NOISE` = 0.1 rad.
* Шум позиции по зрению: `EKF2_EVP_NOISE` = 0.1 m.
* `EKF2_EV_DELAY` = 0.
> **Hint** На данный момент для полета по маркерам рекомендуется использование **LPE**.
Для проверки правильности всех настроек можно [воспользоваться утилитой `selfcheck.py`](selfcheck.md).
@@ -154,7 +154,7 @@ navigate(frame_id='aruco_5', x=0, y=0, z=1)
Для навигации по маркерам, расположенным на потолке, необходимо поставить основную камеру так, чтобы она смотрела вверх и [установить соответствующий фрейм камеры](camera_setup.md#frame).
Также в файле `~/catkin_ws/src/clover/clover/launch/aruco.launch` необходимо установить параметр `known_tilt` в секциях `aruco_detect` и `aruco_map` в значение `map_flipped`:
Также в файле `~/catkin_ws/src/clever/clever/launch/aruco.launch` необходимо установить параметр `known_tilt` в секциях `aruco_detect` и `aruco_map` в значение `map_flipped`:
```xml
<param name="known_tilt" value="map_flipped"/>

View File

@@ -10,13 +10,13 @@
## Настройка
Аргумент `aruco` в файле `~/catkin_ws/src/clover/clover/launch/clover.launch` должен быть в значении `true`:
Аргумент `aruco` в файле `~/catkin_ws/src/clever/clever/launch/clever.launch` должен быть в значении `true`:
```xml
<arg name="aruco" default="true"/>
```
Для включения распознавания маркеров аргумент `aruco_detect` в файле `~/catkin_ws/src/clover/clover/launch/aruco.launch` должен быть в значении `true`:
Для включения распознавания маркеров аргумент `aruco_detect` в файле `~/catkin_ws/src/clever/clever/launch/aruco.launch` должен быть в значении `true`:
```xml
<arg name="aruco_detect" default="true"/>

View File

@@ -1,7 +1,5 @@
# Пошаговая инструкция по настройке автономного полета Клевера 4
> **Note** Документация для версий [образа](image.md), начиная с **0.20**. Для более ранних версий см. [документацию для версии **0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/auto_setup.md).
Данная инструкция содержит ссылки на другие статьи, в которых каждая из затронутых тем разобрана более подробно. Если вы столкнулись с трудностями во время прочтения одной из таких статей, рекомендуется вернуться к данной инструкции, так как здесь многие операции описаны пошагово, а также отсутствуют ненужные шаги.
## Первоначальная настройка Raspberry Pi
@@ -60,7 +58,7 @@ ls
Перейти в папку с прописыванием пути к ней:
```bash
cd catkin_ws/src/clover/clover/launch/
cd catkin_ws/src/clever/clever/launch/
```
Перейти в домашнюю директорию:
@@ -75,10 +73,10 @@ cd
nano file.py
```
Открыть файл clover.launch с прописыванием полного пути к нему (сработает, если вы находитесь в другой папке):
Открыть файл clever.launch с прописыванием полного пути к нему (сработает, если вы находитесь в другой папке):
```bash
nano ~/catkin_ws/src/clover/clover/launch/clover.launch
nano ~/catkin_ws/src/clever/clever/launch/clever.launch
```
Сохранить файл (нажимать последовательно):
@@ -108,13 +106,13 @@ sudo reboot
Перезапуск только систем Клевера:
```bash
sudo systemctl restart clover
sudo systemctl restart clever
```
Выполнить самопроверку Клевера:
```bash
rosrun clover selfcheck.py
rosrun clever selfcheck.py
```
Остановить программу
@@ -132,7 +130,7 @@ python myprogram.py
Журнал событий процессов Клевера. Пролистывать список можно нажатием Enter или сочетанием клавиш Ctrl+V (пролистывает быстрее):
```bash
journalctl -u clover
journalctl -u clever
```
Открыть файл sudoers от имени администратора (он не откроется без прописывания sudo. Через sudo можно запускать другие команды, если они не открываются без прав администратора):
@@ -143,42 +141,42 @@ sudo nano /etc/sudoers
## Настройка параметров Raspberry Pi для автономного полета
Большинство параметров, необходимых для полета, хранится в папке `~/catkin_ws/src/clover/clover/launch/`.
Большинство параметров, необходимых для полета, хранится в папке `~/catkin_ws/src/clever/clever/launch/`.
- Зайти в папку:
```bash
cd ~/catkin_ws/src/clover/clover/launch/
cd ~/catkin_ws/src/clever/clever/launch/
```
Символ `~` обозначает домашнюю директорию вашего пользователя. Если вы уже находитесь в ней, можно обойтись командой:
`cd catkin_ws/src/clover/clover/launch/`
`cd catkin_ws/src/clever/clever/launch/`
> **Hint** Клавишей Tab можно автоматически дополнить названия файлов, папок или команд. Нужно начать вводить желаемое название и нажать Tab. Если не будет конфликтов, название напишется полностью. Например, чтобы быстро ввести путь к папке с настройками, после ввода `cd` можно начать вводить следующую комбинацию клавиш: `c-Tab-s-Tab-c-Tab-c-Tab-l-Tab`. Таким образом можно сэкономить много времени при написании длинной команды, а также избежать возможных ошибок в написании пути.
- В этой папке необходимо сконфигурировать несколько файлов:
- `clover.launch`
- `clever.launch`
- `aruco.launch`
- `main_camera.launch`
- Открыть файл `clover.launch`:
- Открыть файл `clever.launch`:
```bash
nano clover.launch
nano clever.launch
```
Вы должны находиться в папке, в которой располагается файл. Если вы находитесь в другой папке, файл можно открыть, прописав полный путь к нему:
```bash
nano ~/catkin_ws/src/clover/clover/launch/clover.launch
nano ~/catkin_ws/src/clever/clever/launch/clever.launch
```
Если файл одновременно редактируют два пользователя, а также если в прошлый раз закрытие файла произошло некорректно, программа nano не отобразит файл сразу, а попросит дополнительное разрешение. Для этого нужно нажать клавишу Y.
Если содержимое файла все равно пусто, возможно, вы неверно ввели имя файла. Нужно обращать внимание на расширение и вписывать его полностью. Если вы вписали неверное имя или расширение, программа nano создаст пустой файл с этим названием, что нежелательно. Такой файл следует удалить.
- В файле clover.launch найти строчку:
- В файле clever.launch найти строчку:
```
<arg name="aruco" default="false"/>
@@ -216,7 +214,7 @@ sudo nano /etc/sudoers
- нумерация идет с верхнего левого угла (ключ `--top-left`)
```bash
rosrun aruco_pose genmap.py 0.335 10 10 1 1 0 > ~/catkin_ws/src/clover/aruco_pose/map/map.txt --top-left
rosrun aruco_pose genmap.py 0.335 10 10 1 1 0 > ~/catkin_ws/src/clever/aruco_pose/map/map.txt --top-left
```
В большинстве полей нумерация начинается с нулевой метки. Также в большинстве случаев нумерация начинается с верхнего левого угла, поэтому при генерации очень важно указывать ключ `--top-left`.
@@ -266,7 +264,7 @@ sudo nano /etc/sudoers
- Перезагрузите модуль Клевер:
```bash
sudo systemctl restart clover
sudo systemctl restart clever
```
## Настройка полетного контроллера для автономного полета
@@ -297,7 +295,7 @@ sudo nano /etc/sudoers
- Выполнить команду:
```bash
rosrun clover selfcheck.py
rosrun clever selfcheck.py
```
## Написание программы

View File

@@ -1,38 +1,36 @@
Автозапуск ПО
===
> **Note** В версии образа **0.20** пакет и сервис `clever` был переименован в `clover`. Для более ранних версий см. документацию для версии [**0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/autolaunch.md).
systemd
---
Основная документация: [https://wiki.archlinux.org/index.php/Systemd_(Русский)](https://wiki.archlinux.org/index.php/Systemd_(Русский)).
Все автоматически стартуемое ПО Клевера запускается в виде systemd-сервиса `clover.service`.
Все автоматически стартуемое ПО Клевера запускается в виде systemd-сервиса `clever.service`.
Сервис может быть перезапущен командой `systemctl`:
```bash
sudo systemctl restart clover
sudo systemctl restart clever
```
Текстовый вывод ПО можно просмотреть с помощью команды `journalctl`:
```bash
journalctl -u clover
journalctl -u clever
```
Для того, запустить ПО Клевера непосредственно в текущей консольной сессии, вы можете использовать `roslaunch`:
```bash
sudo systemctl stop clover
roslaunch clover clover.launch
sudo systemctl stop clever
roslaunch clever clever.launch
```
Вы можете выключить автозапуск ПО Клевера с помощью команды `disable`:
```bash
sudo systemctl disable clover
sudo systemctl disable clever
```
roslaunch
@@ -40,12 +38,12 @@ roslaunch
Основная документация: http://wiki.ros.org/roslaunch.
Список объявленных для запуска нод / программ указывается в файле `/home/pi/catkin_ws/src/clover/clover/launch/clover.launch`.
Список объявленных для запуска нод / программ указывается в файле `/home/pi/catkin_ws/src/clever/clever/launch/clever.launch`.
Вы можете добавить собственную ноду в список автозапускаемых. Для этого разместите ваш запускаемый файл (например, `my_program.py`) в каталог `/home/pi/catkin_ws/src/clover/clover/src`. Затем добавьте запуск вашей ноды в `clover.launch`, например:
Вы можете добавить собственную ноду в список автозапускаемых. Для этого разместите ваш запускаемый файл (например, `my_program.py`) в каталог `/home/pi/catkin_ws/src/clever/clever/src`. Затем добавьте запуск вашей ноды в `clever.launch`, например:
```xml
<node name="my_program" pkg="clover" type="my_program.py" output="screen"/>
<node name="my_program" pkg="clever" type="my_program.py" output="screen"/>
```
Запускаемый файл должен иметь *permission* на запуск:

View File

@@ -1,10 +1,8 @@
# Работа с камерой
> **Note** В версии образа **0.20** пакет и сервис `clever` был переименован в `clover`. Для более ранних версий см. документацию для версии [**0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/camera.md).
<!-- TODO: физическое подключение -->
Для работы с основной камерой необходимо убедиться что она включена в файле `~/catkin_ws/src/clover/clover/launch/clover.launch`:
Для работы с основной камерой необходимо убедиться что она включена в файле `~/catkin_ws/src/clever/clever/launch/clever.launch`:
```xml
<arg name="main_camera" default="true"/>
@@ -12,10 +10,10 @@
Также нужно убедиться, что камера [сфокусирована и для нее указано корректное расположение и ориентация](camera_setup.md).
При изменении launch-файла необходимо перезапустить пакет `clover`:
При изменении launch-файла необходимо перезапустить пакет `clever`:
```bash
sudo systemctl restart clover
sudo systemctl restart clever
```
Для мониторинга изображения с камеры можно использовать [rqt](rviz.md) или [web_video_server](web_video_server.md).
@@ -27,7 +25,7 @@ sudo systemctl restart clover
Остановите сервисы Клевера:
```bash
sudo systemctl stop clover
sudo systemctl stop clever
```
Получите картинку с камеры утилитой `raspistill`:
@@ -92,7 +90,7 @@ image_pub.publish(bridge.cv2_to_imgmsg(cv_image, 'bgr8'))
Получаемые изображения можно просматривать используя [web_video_server](web_video_server.md).
> **Warning** По умолчанию web_video_server показывает изображения из топиков со сжатием (например, /main_camera/image_raw/compressed). Ноды на Python не публикуют такие топики, поэтому для их просмотра следует добавлять `&type=mjpeg` в адресную стоку страницы web_video_server или изменить параметр `default_stream_type` на `mjpeg` в файле `clover.launch`.
> **Warning** По умолчанию web_video_server показывает изображения из топиков со сжатием (например, /main_camera/image_raw/compressed). Ноды на Python не публикуют такие топики, поэтому для их просмотра следует добавлять `&type=mjpeg` в адресную стоку страницы web_video_server или изменить параметр `default_stream_type` на `mjpeg` в файле `clever.launch`.
#### Получение одного кадра

View File

@@ -224,7 +224,7 @@ cv2.destroyAllWindows()
![img](../assets/wcp1.png)
Нажимаем “Войти”. Переходим в ***/home/pi/catkin_ws/src/clover/clover/camera_info/*** и копируем туда калибровочный .yaml файл:
Нажимаем “Войти”. Переходим в ***/home/pi/catkin_ws/src/clever/clever/camera_info/*** и копируем туда калибровочный .yaml файл:
![img](../assets/wcp2.jpg)
@@ -234,7 +234,7 @@ cv2.destroyAllWindows()
![img](../assets/pty1.jpg)
Войдем под логином ***pi*** и паролем ***raspberry***, перейдем в директорию ***/home/pi/catkin_ws/src/clover/clover/launch*** и начнем редактировать конфигурацию ***main_camera.launch***:
Войдем под логином ***pi*** и паролем ***raspberry***, перейдем в директорию ***/home/pi/catkin_ws/src/clever/clever/launch*** и начнем редактировать конфигурацию ***main_camera.launch***:
![img](../assets/pty2.jpg)

View File

@@ -43,4 +43,4 @@
Когда калибровка завершится, в терминале вы увидите полученные параметры. В окне отобразится изображение с выправленными искажениями. При успешной калибровке все реальные прямые линии должны остаться прямыми на полученном изображении.
7. Нажмите *COMMIT*, чтобы сохранить полученные параметры калибровки. Результат будет записан в файл калибровки основной камеры Клевера:
`/home/pi/catkin_ws/src/clover/clover/camera_info/fisheye_cam.yaml`.
`/home/pi/catkin_ws/src/clever/clever/camera_info/fisheye_cam_320.yaml`.

View File

@@ -15,7 +15,7 @@ ls
Перейти в директорию:
```bash
cd catkin_ws/src/clover/clover/launch/
cd catkin_ws/src/clever/clever/launch/
```
Перейти на директорию выше:
@@ -65,16 +65,16 @@ sudo reboot
Например:
```bash
nano ~/catkin_ws/src/clover/clover/launch/clover.launch
nano ~/catkin_ws/src/clever/clever/launch/clever.launch
```
<img src="../assets/nano.png" alt="Редактирование файла в nano" data-action="zoom">
2. Отредактируйте файл.
3. Для выхода с сохранением нажмите `Ctrl`+`X`, `Y`, `Enter`.
4. При изменении .launch-файлов необходимо перезапустить пакет `clover`:
4. При изменении .launch-файлов необходимо перезапустить пакет `clever`:
```bash
sudo systemctl restart clover
sudo systemctl restart clever
```
Для редактирования файлов также можно использовать и другие редакторы, например, **vim**.

View File

@@ -20,24 +20,22 @@
## Подключение по UART
> **Note** В версии образа **0.20** пакет и сервис `clever` был переименован в `clover`. Для более ранних версий см. документацию для версии [**0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/connection.md).
<!-- TODO схема подключения -->
Дополнительным способом подключения является подключение подключение по интерфейсу UART.
1. Подключите Raspberry Pi к полетному контроллеру по UART.
2. [Подключитесь в Raspberry Pi по SSH](ssh.md).
3. Поменяйте в launch-файле Клевера (`~/catkin_ws/src/clover/clover/launch/clover.launch`) тип подключения на UART:
3. Поменяйте в launch-файле Клевера (`~/catkin_ws/src/clever/clever/launch/clever.launch`) тип подключения на UART:
```xml
<arg name="fcu_conn" default="uart"/>
```
При изменении launch-файла необходимо перезапустить сервис `clover`:
При изменении launch-файла необходимо перезапустить пакет `clever`:
```bash
sudo systemctl restart clover
sudo systemctl restart clever
```
> **Hint** Для корректной работы подключения Raspberry Pi и полетного контроллера по UART необходимо установить значение параметра `SYS_COMPANION` на 921600.

View File

@@ -47,7 +47,7 @@
2. Склонируйте форк на компьютер:
```bash
git clone https://github.com/<USERNAME>/clover.git
git clone https://github.com/<USERNAME>/clever.git
```
3. Перейдите в директорию с форком и создайте новую ветку с названием вашей статьи (например `new-article`):

View File

@@ -6,7 +6,7 @@ Pixhawk или Pixracer можно прошить, используя QGroundCon
Прошивка для Клевера
---
Для Клевера рекомендуется использование специальной сборки PX4, которая содержит необходимые исправления и более подходящие параметры по умолчанию. Используйте последний стабильный релиз в [GitHub-репозитории](https://github.com/CopterExpress/Firmware/releases), содержащий слово `clover`, например `v1.8.2-clover.4`.
Для Клевера рекомендуется использование специальной сборки PX4, которая содержит необходимые исправления и более подходящие параметры по умолчанию. Используйте последний стабильный релиз в [GitHub-репозитории](https://github.com/CopterExpress/Firmware/releases), содержащий слово `clever`, например `v1.8.2-clever.4`.
<div id="release" style="display:none">
<p>Последний стабильный релиз: <strong><a id="download-latest-release"></a></strong>.</p>
@@ -25,8 +25,8 @@ Pixhawk или Pixracer можно прошить, используя QGroundCon
// look for stable release
let stable;
for (let release of data) {
let clover = (release.name.indexOf('clover') != -1) || (release.name.indexOf('clever') != -1);
if (clover && !release.prerelease && !release.draft) {
let clever = release.name.indexOf('clever') != -1;
if (clever && !release.prerelease && !release.draft) {
stable = release;
break;
}

View File

@@ -5,7 +5,7 @@
![Системы координаты Клевера (TF2)](../assets/frames.png)
Основные фреймы в пакете `clover`:
Основные фреймы в пакете `clever`:
* `map` — координаты относительно точки инициализации полетного контроллера: белая сетка на иллюстрации;
* `base_link` — координаты относительно квадрокоптера: схематичное изображение квадрокоптера на иллюстрации;

View File

@@ -1,6 +1,6 @@
# Подключение QGroundControl по Wi-Fi
Возможны контроль, управление, калибровка и настройка полетного контроллера квадрокоптера с помощью программы QGroundControl по Wi-Fi. Для этого необходимо [подключиться к Wi-Fi](wifi.md) сети `clover-xxxx`.
Возможны контроль, управление, калибровка и настройка полетного контроллера квадрокоптера с помощью программы QGroundControl по Wi-Fi. Для этого необходимо [подключиться к Wi-Fi](wifi.md) сети `CLEVER-xxxx`.
## Подключение
@@ -20,12 +20,12 @@
## UDP
Также возможна настройка подключения по протоколу UDP. Для выбора различных вариантов подключения по UDP необходимо отредактировать параметр `gcs_bridge` в launch-файле `/home/pi/catkin_ws/src/clover/clover/launch/clover.launch`.
Также возможна настройка подключения по протоколу UDP. Для выбора различных вариантов подключения по UDP необходимо отредактировать параметр `gcs_bridge` в launch-файле `/home/pi/catkin_ws/src/clever/clever/launch/clever.launch`.
После изменения launch-файла необходимо перезагрузить сервис clover:
После изменения launch-файла необходимо перезагрузить сервис clever:
```(bash)
sudo systemctl restart clover
sudo systemctl restart clever
```
## UDP-бридж с автоматическим подключением
@@ -40,7 +40,7 @@ sudo systemctl restart clover
![QGroundControl UDP connection](../assets/bridge_udp.png)
3. Выберите созданное подключение и нажмите *Connect*.
3. Выберите в списке подключений *CLEVER* и нажмите *Connect*.
## UDP broadcast-бридж

View File

@@ -1,13 +1,11 @@
# Имя хоста
> **Note** Документация для версий [образа](image.md), начиная с **0.20**. Для более ранних версий см. [документацию для версии **0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/hostname.md).
[По умолчанию](image.md) на Клевере установлено имя хоста (hostname) `clever-xxxx`, где `xxxx` случайные цифры. Имя хоста соответствует SSID [точки доступа Wi-Fi](wifi.md).
[По умолчанию](image.md) на Клевере установлено имя хоста (hostname) `clover-xxxx`, где `xxxx` случайные цифры. Имя хоста соответствует SSID [точки доступа Wi-Fi](wifi.md).
Таким образом, Клевер доступен на машинах, поддерживающих mDNS, под именем `clover-xxxx.local`. Вы можете использовать это имя для SSH-доступа на Клевер:
Таким образом, Клевер доступен на машинах, поддерживающих mDNS, под именем `clever-xxxx.local`. Вы можете использовать это имя для SSH-доступа на Клевер:
```bash
ssh pi@clover-xxxx.local
ssh pi@clever-xxxx.local
```
Также это имя может быть использовано вместо IP-адреса для открытия страницы Клевера в браузере и т. д.

View File

@@ -1,6 +1,6 @@
# Автоматическая сборка и модификация образа Клевера
Иногда возникает необходимость в сборке модифицированного образа системы, например для [своего проекта](https://github.com/artem30801/CleverSwarm) на базе [Клевера](https://github.com/copterexpress/clover). За основу можно взять, например, чистый образ Raspbian Stretch и модифицировать его с нуля, пройдя те же этапы, через который проходит сборка образа Клевера, добавив свои модификации. Однако на данный момент времени сборка образа Клевера занимает [чуть больше часа](https://travis-ci.org/CopterExpress/clover), что превышает ограничения бесплатной сборки в Travis \(50 минут\). Соответственно для проектов на базе Клевера имеет смысл брать за основу уже готовый образ и кастомизировать его. Концепция и основные этапы для автоматизированной сборки изложены ниже.
Иногда возникает необходимость в сборке модифицированного образа системы, например для [своего проекта](https://github.com/artem30801/CleverSwarm) на базе [Клевера](https://github.com/copterexpress/clover). За основу можно взять, например, чистый образ Raspbian Stretch и модифицировать его с нуля, пройдя те же этапы, через который проходит сборка образа Клевера, добавив свои модификации. Однако на данный момент времени сборка образа Клевера занимает [чуть больше часа](https://travis-ci.org/CopterExpress/clever), что превышает ограничения бесплатной сборки в Travis \(50 минут\). Соответственно для проектов на базе Клевера имеет смысл брать за основу уже готовый образ и кастомизировать его. Концепция и основные этапы для автоматизированной сборки изложены ниже.
## Концепция

View File

@@ -1,54 +0,0 @@
# Работа с ROS из браузера
С помощью библиотеки [`roslibjs`](http://wiki.ros.org/roslibjs) возможна работа со всеми ресурсами ROS (топики, сервисы, параметры) из JavaScript-кода внутри браузера, что позволяет создавать различные интерактивные браузерные приложения для коптера.
Все необходимое для работы с `roslibjs` предустановлено и настроено на [образе для RPi для Клевера](image.md).
## Пример
Пример HTML-кода страницы, работающей с `roslib.js`:
```html
<html>
<script src="js/roslib.js"></script>
<script type="text/javascript">
// Establish roslibjs connection
var ros = new ROSLIB.Ros({ url: 'ws://' + location.hostname + ':9090' });
ros.on('connection', function () {
// Connection callback
alert('Connected');
});
// Declare get_telemetry service client
var getTelemetry = new ROSLIB.Service({ ros: ros, name : '/get_telemetry', serviceType : 'clover/GetTelemetry' });
// Call get_telemetry
getTelemetry.callService(new ROSLIB.ServiceRequest({ frame_id: 'map' }), function(result) {
// Service respond callback
alert('Telemetry: ' + JSON.stringify(result));
});
// Subscribe to `/mavros/state` topic
var stateSub = new ROSLIB.Topic({ ros : ros, name : '/mavros/state', messageType : 'mavros_msgs/State' });
stateSub.subscribe(function(msg) {
// Topic message callback
console.log('State: ', msg);
});
</script>
</html>
```
[Взлет, посадка и все остальные операции](programming.md) могут быть осуществлены аналогичным образом.
Страница должна быть помещена в каталог `/home/pi/catkin_ws/src/clover/clover/www/`. После этого она станет доступна по адресу `http://192.168.11.1/<имя_страницы>.html`. При открытии страницы браузер должен показать окно с телеметрией дрона, а также постоянно выводить состояние полетного контроллера в консоль.
<img src="../assets/js-ros.png" class="center zoom"/>
Более подробную информацию смотрите в [туториале по `roslibjs`](http://wiki.ros.org/roslibjs/Tutorials/BasicRosFunctionality).
## Браузерная GCS
Смотрите также пример реализации упрощенной браузерной наземной станции (GCS) на Клевере по адресу http://192.168.11.1/gcs.html.
<img src="../assets/web-gcs.png" class="center zoom"/>

View File

@@ -110,7 +110,7 @@ cd ~/catkin_ws
catkin_make
```
> **Hint** При подключении полётных контроллеров на базе PX4 через USB следует также добавить правила udev в систему. Скопируйте [файл с правилами](https://github.com/CopterExpress/clover/blob/master/clover/config/99-px4fmu.rules) в `/etc/udev/rules.d` и выполните команду `sudo udevadm control --reload-rules && sudo udevadm trigger`.
> **Hint** При подключении полётных контроллеров на базе PX4 через USB следует также добавить правила udev в систему. Скопируйте [файл с правилами](https://github.com/CopterExpress/clover/blob/master/clever/config/99-px4fmu.rules) в `/etc/udev/rules.d` и выполните команду `sudo udevadm control --reload-rules && sudo udevadm trigger`.
### Запуск Клеверных нод
@@ -124,10 +124,10 @@ source devel/setup.bash
Поменяйте launch-файлы так, чтобы это соответствовало вашей конфигурации, и запустите ноды с помощью `roslaunch`:
```bash
roslaunch clover clover.launch
roslaunch clever clever.launch
```
> **Hint** Вы можете настроить `systemd` так, чтобы ноды Клевера запускались автоматически. Примером такой настройки может служить образ Клевера для Raspberry Pi: там созданы сервисы [`roscore`](https://github.com/CopterExpress/clover/blob/master/builder/assets/roscore.service) и [`clover`](https://github.com/CopterExpress/clover/blob/master/builder/assets/clover.service). Их можно подкорректировать и использовать в Jetson Nano.
> **Hint** Вы можете настроить `systemd` так, чтобы ноды Клевера запускались автоматически. Примером такой настройки может служить образ Клевера для Raspberry Pi: там созданы сервисы [`roscore`](https://github.com/CopterExpress/clover/blob/master/builder/assets/roscore.service) и [`clever`](https://github.com/CopterExpress/clover/blob/master/builder/assets/clever.service). Их можно подкорректировать и использовать в Jetson Nano.
## Возможные проблемы

View File

@@ -10,7 +10,18 @@
### Подключение к Raspberry Pi
> **Hint** Для корректной работы лазерного дальномера с полетным контроллером рекомендуется использование [специальной сборки PX4 для Клевера](firmware.md#прошивка-для-клевера).
> **Note** Для корректной работы лазерного дальномера с полетным контроллером необходима <a id="download-firmware" href="https://github.com/CopterExpress/Firmware/releases">кастомная прошивка PX4</a>. Подробнее про прошивку см. [соответствующую статью](firmware.md).
<script type="text/javascript">
fetch('https://api.github.com/repos/CopterExpress/Firmware/releases').then(res => res.json()).then(function(data) {
for (let release of data) {
if (!release.prerelease && !release.draft && release.tag_name.includes('-clever.')) {
document.querySelector('#download-firmware').href = release.html_url;
return;
}
}
});
</script>
Подключите дальномер по интерфейсу I²C к пинам 3V, GND, SCL и SDA:
@@ -22,7 +33,7 @@
### Включение
[Подключитесь по SSH](ssh.md) и отредактируйте файл `~/catkin_ws/src/clover/clover/launch/clover.launch` так, чтобы драйвер VL53L1X был включен:
[Подключитесь по SSH](ssh.md) и отредактируйте файл `~/catkin_ws/src/clever/clever/launch/clever.launch` так, чтобы драйвер VL53L1X был включен:
```xml
<arg name="rangefinder_vl53l1x" default="true"/>

View File

@@ -1,6 +1,6 @@
# Работа со светодиодной лентой
> **Note** Документация для версий [образа](image.md), начиная с **0.20**. Для более ранних версий см. [документацию для версии **0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/leds.md).
> **Note** Документация для версии образа, начиная с 0.18. Для более ранних версий см. [предыдущую версию статьи](leds_old.md).
Адресуемая RGB-светодиодная лента типа *ws281x*, которая входит в наборы "Клевер", позволяет выставлять произвольные 24-битные цвета на каждый из отдельных светодиодов. Это позволяет сделать полет Клевера более ярким, а также визуально получать информацию о полетных режимах, этапе выполнения пользовательской программы и других событиях.
@@ -17,13 +17,13 @@
## Высокоуровневое управление лентой
1. Для работы с лентой подключите ее к питанию +5v 5v, земле GND GND и сигнальному порту DIN GPIO21. Обратитесь [к инструкции по сборке](assemble_4.md#Подключение-светодиодной-ленты-к-Raspberry-Pi) для подробностей.
2. Включите поддержку LED-ленты в файле `~/catkin_ws/src/clover/clover/launch/clover.launch`:
2. Включите поддержку LED-ленты в файле `~/catkin_ws/src/clever/clever/launch/clever.launch`:
```xml
<arg name="led" default="true"/>
```
3. Настройте параметры подключения ленты *ws281x* в файле `~/catkin_ws/src/clover/clover/launch/led.launch`. Необходимо ввести верное количество светодиодов в ленте и GPIO-пин, использованный для подключения (если он отличается от *GPIO21*):
3. Настройте параметры подключения ленты *ws281x* в файле `~/catkin_ws/src/clever/clever/launch/led.launch`. Необходимо ввести верное количество светодиодов в ленте и GPIO-пин, использованный для подключения (если он отличается от *GPIO21*):
```xml
<param name="led_count" value="30"/> <!-- количество светодиодов в ленте -->
@@ -50,7 +50,7 @@
```python
import rospy
from clover.srv import SetLEDEffect
from clever.srv import SetLEDEffect
# ...
@@ -88,7 +88,7 @@ rosservice call /led/set_effect "{effect: 'rainbow'}"
## Настройка реакции ленты на события
Клевер умеет показывать LED-лентой текущее состояние полетного контроллера и сигнализировать о событиях. Данная функция настраивается в файле `~/catkin_ws/src/clover/clover/launch/led.launch` в разделе *events effects table*. Пример настройки:
Клевер умеет показывать LED-лентой текущее состояние полетного контроллера и сигнализировать о событиях. Данная функция настраивается в файле `~/catkin_ws/src/clever/clever/launch/led.launch` в разделе *events effects table*. Пример настройки:
```xml
startup: { r: 255, g: 255, b: 255 }
@@ -110,7 +110,7 @@ disconnected: { effect: blink, r: 255, g: 50, b: 50 }
> **Note** Для корректной работы сигнализации LED-лентой о низком заряде батареи необходимо корректная [калибровка электропитания](power.md#Калибровка-делителя-напряжения).
Для того, чтобы отключить реакцию светодиодной ленты на события, установите аргумент `led_notify` в файле `~/catkin_ws/src/clover/clover/launch/led.launch` в значение `false`:
Для того, чтобы отключить реакцию светодиодной ленты на события, установите аргумент `led_notify` в файле `~/catkin_ws/src/clever/clever/launch/led.launch` в значение `false`:
```xml
<arg name="led_notify" default="false"/>

View File

@@ -12,7 +12,7 @@ MAVROS подписывается на определенные ROS-топики
<!-- -->
> **Note** В пакете `clover` некоторые плагины MAVROS отключены (в целях сохранения ресурсов). Подробнее см. параметр `plugin_blacklist` в файле `/home/pi/catkin_ws/src/clover/clover/launch/mavros.launch`.
> **Note** В пакете `clever` некоторые плагины MAVROS отключены (в целях сохранения ресурсов). Подробнее см. параметр `plugin_blacklist` в файле `/home/pi/catkin_ws/src/clever/clever/launch/mavros.launch`.
## Основные сервисы

View File

@@ -400,7 +400,7 @@
| -- |:---------------------------------| :----------------------------------|
| 1 | Введение | Поприветствовать учеников. Провести опрос или тестирование по пройденным темам. Сформулировать тему и цель урока. Сделать упор на то, что на занятии будет решаться задача написания программы для настоящего автономного полета. |
| 2 | Системы координат | Рассказать про локальную и глобальную систему координат. Объяснить почему ориентации по локальной системе координат недостаточно. Рассказать о дополнительных системах координат, которые появляются благодаря получению дополнительной информации с камеры и внешних датчиков. |
| 3 | Включение и использование камеры | Необходимо попросить учащихся убедиться, что в launch-файле Клевера (~/catkin_ws/src/clover/clover/clover.launch) включен запуск aruco_pose и нижней камеры для компьютерного зрения: <arg name="bottom_camera" default="true"/> <arg name="aruco" default="true"/> При изменении launch-файла необходимо перезапустить пакет clover: sudo systemctl restart clover Проверить видео, полученное с камеры перейдя по адресу http://192.168.11.1:8080/. |
| 3 | Включение и использование камеры | Необходимо попросить учащихся убедиться, что в launch-файле Клевера (~/catkin_ws/src/clever/clever/clever.launch) включен запуск aruco_pose и нижней камеры для компьютерного зрения: <arg name="bottom_camera" default="true"/> <arg name="aruco" default="true"/> При изменении launch-файла необходимо перезапустить пакет clever: sudo systemctl restart clever Проверить видео, полученное с камеры перейдя по адресу http://192.168.11.1:8080/. |
| 4 | Распознавание меток | Рассказать каким образом распознаются метки и как они образуют систему координат. Спросить у учащихся есть ли вопросы на текущий момент. |
| 5 | Программирование и автономный полет | Предложить учащимся написать программу для взлета над меткой и посадки на нее. Рассказать о структуре программы, которая может выполнить эту задачу и привести пример кода с использованием функций: ● navigate, ● set_position ● set_velocity. Проверить и скорректировать программы, написанные учащимися. Рассказать, каким образом осуществляется перехват коптера в ручное управление. Протестировать написанные программы. |
| 6 | Заключение | Подвести итоги занятия, спросить, есть ли у класса вопросы, их должно быть много, нужно заранее продумать ответы на них. Попросить учеников ответить на контрольные вопросы. Предложить ученикам по желанию провести в интернете дополнительное исследование на пройденную тему. Сообщить ученикам, какую тему они будут проходить на следующем занятии. |

View File

@@ -20,7 +20,7 @@ Wi-Fi адаптер на Raspberry Pi имеет два основных реж
```txt
network={
ssid="my-super-ssid"
psk="cloverwifi123"
psk="cleverwifi123"
mode=2
proto=RSN
key_mgmt=WPA-PSK
@@ -90,8 +90,8 @@ Wi-Fi адаптер на Raspberry Pi имеет два основных реж
country=GB
network={
ssid="clover-1234"
psk="cloverwifi"
ssid="CLEVER-1234"
psk="cleverwifi"
mode=2
proto=RSN
key_mgmt=WPA-PSK
@@ -101,7 +101,7 @@ Wi-Fi адаптер на Raspberry Pi имеет два основных реж
}
```
где `clover-1234` название сети, а `cloverwifi` пароль.
где `CLEVER-1234` название сети, а `cleverwifi` пароль.
3. Включите службу `dnsmasq`.
@@ -155,8 +155,8 @@ update_config=1
country=GB
network={
ssid=\"my-clover\"
psk=\"cloverwifi\"
ssid=\"CLEVER-SMIRNOV\"
psk=\"cleverwifi\"
mode=2
proto=RSN
key_mgmt=WPA-PSK
@@ -212,7 +212,7 @@ sudo apt install dnsmasq-base
```bash
# Вызов dnsmasq-base
sudo dnsmasq --interface=wlan0 --address=/clover/coex/192.168.11.1 --no-daemon --dhcp-range=192.168.11.100,192.168.11.200,12h --no-hosts --filterwin2k --bogus-priv --domain-needed --quiet-dhcp6 --log-queries
sudo dnsmasq --interface=wlan0 --address=/clever/coex/192.168.11.1 --no-daemon --dhcp-range=192.168.11.100,192.168.11.200,12h --no-hosts --filterwin2k --bogus-priv --domain-needed --quiet-dhcp6 --log-queries
# Подробнее о dnsmasq-base
dnsmasq --help
@@ -230,7 +230,7 @@ sudo apt install dnsmasq
```bash
cat << EOF | sudo tee -a /etc/dnsmasq.conf
interface=wlan0
address=/clover/coex/192.168.11.1
address=/clever/coex/192.168.11.1
dhcp-range=192.168.11.100,192.168.11.200,12h
no-hosts
filterwin2k

Some files were not shown because too many files have changed in this diff Show More