Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc7fb94d63 | ||
|
|
2bedc6cd31 | ||
|
|
c0f748756b | ||
|
|
181a8aeb1b | ||
|
|
c45f7b8148 | ||
|
|
1d21665c16 | ||
|
|
b87d3c612b | ||
|
|
d6757d67f8 | ||
|
|
376e44ec6c | ||
|
|
94402d96ad | ||
|
|
d3a1bf7eb6 | ||
|
|
beb9370fc5 |
@@ -1,21 +1,12 @@
|
||||
PODS:
|
||||
- MarqueeLabel/Swift (3.1.4)
|
||||
- NotificationBannerSwift (1.5.4):
|
||||
- MarqueeLabel/Swift
|
||||
- SnapKit (~> 4.0)
|
||||
- SnapKit (4.0.0)
|
||||
- SwiftSocket (2.0.2)
|
||||
|
||||
DEPENDENCIES:
|
||||
- NotificationBannerSwift
|
||||
- SwiftSocket (~> 2.0)
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
MarqueeLabel: bf768455fe88d427f71476ebb23f9092b660f40b
|
||||
NotificationBannerSwift: 4f6666c8421dcf11be0812dd1093d932c15921af
|
||||
SnapKit: a42d492c16e80209130a3379f73596c3454b7694
|
||||
SwiftSocket: 6f4c9c63fbc5c1d61188936bb3c599fd546f40ae
|
||||
|
||||
PODFILE CHECKSUM: fd5199f69c3ee8c1fbc0dd582477d890c8b2a24f
|
||||
PODFILE CHECKSUM: 2044f57d00f536792fbc38c63ded4fa78dcc135c
|
||||
|
||||
COCOAPODS: 1.4.0
|
||||
|
||||
@@ -226,16 +226,10 @@
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-cleverrc/Pods-cleverrc-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/MarqueeLabel/MarqueeLabel.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/NotificationBannerSwift/NotificationBannerSwift.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/SwiftSocket/SwiftSocket.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MarqueeLabel.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NotificationBannerSwift.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftSocket.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -397,7 +391,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7QY6KJ2672;
|
||||
DEVELOPMENT_TEAM = M8TDN3PAH2;
|
||||
INFOPLIST_FILE = cleverrc/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = coex.cleverrc;
|
||||
@@ -413,7 +407,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7QY6KJ2672;
|
||||
DEVELOPMENT_TEAM = M8TDN3PAH2;
|
||||
INFOPLIST_FILE = cleverrc/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = coex.cleverrc;
|
||||
|
||||
@@ -3,114 +3,176 @@
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "cleverrc40.png",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "clever60.png",
|
||||
"filename" : "Icon-App-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "clever58.png",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "clever87.png",
|
||||
"filename" : "Icon-App-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "clever80.png",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "clever120.png",
|
||||
"filename" : "Icon-App-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "clever120-1.png",
|
||||
"filename" : "Icon-App-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "clever180-1.png",
|
||||
"filename" : "Icon-App-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "clever20.png",
|
||||
"filename" : "Icon-App-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "clever40.png",
|
||||
"filename" : "Icon-App-20x20@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "clever29.png",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "clever58-1.png",
|
||||
"filename" : "Icon-App-29x29@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "clever40-1.png",
|
||||
"filename" : "Icon-App-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "clever80-1.png",
|
||||
"filename" : "Icon-App-40x40@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "clever76.png",
|
||||
"filename" : "Icon-App-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "clever152.png",
|
||||
"filename" : "Icon-App-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "clever167.png",
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "clever1024.png",
|
||||
"filename" : "ItunesArtwork@2x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "24x24",
|
||||
"idiom" : "watch",
|
||||
"scale" : "2x",
|
||||
"role" : "notificationCenter",
|
||||
"subtype" : "38mm"
|
||||
},
|
||||
{
|
||||
"size" : "27.5x27.5",
|
||||
"idiom" : "watch",
|
||||
"scale" : "2x",
|
||||
"role" : "notificationCenter",
|
||||
"subtype" : "42mm"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "watch",
|
||||
"role" : "companionSettings",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "watch",
|
||||
"role" : "companionSettings",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "watch",
|
||||
"scale" : "2x",
|
||||
"role" : "appLauncher",
|
||||
"subtype" : "38mm"
|
||||
},
|
||||
{
|
||||
"size" : "44x44",
|
||||
"idiom" : "watch",
|
||||
"scale" : "2x",
|
||||
"role" : "longLook",
|
||||
"subtype" : "42mm"
|
||||
},
|
||||
{
|
||||
"size" : "86x86",
|
||||
"idiom" : "watch",
|
||||
"scale" : "2x",
|
||||
"role" : "quickLook",
|
||||
"subtype" : "38mm"
|
||||
},
|
||||
{
|
||||
"size" : "98x98",
|
||||
"idiom" : "watch",
|
||||
"scale" : "2x",
|
||||
"role" : "quickLook",
|
||||
"subtype" : "42mm"
|
||||
},
|
||||
{
|
||||
"idiom" : "watch-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"pre-rendered" : true
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 638 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 508 B |
|
Before Width: | Height: | Size: 659 B |
|
Before Width: | Height: | Size: 867 B |
|
Before Width: | Height: | Size: 867 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 867 B |
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>1.1</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>5</string>
|
||||
<string>6</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
import UIKit
|
||||
import WebKit
|
||||
import SwiftSocket
|
||||
import NotificationBannerSwift
|
||||
import AudioToolbox.AudioServices
|
||||
|
||||
class ViewController: UIViewController, WKScriptMessageHandler {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<arg name="fcu_ip" default="127.0.0.1"/>
|
||||
<arg name="gcs_bridge" default="tcp"/>
|
||||
<arg name="viz" default="true"/>
|
||||
<arg name="web_server" default="false"/>
|
||||
<arg name="web_server" default="true"/>
|
||||
<arg name="web_video_server" default="true"/>
|
||||
<arg name="rosbridge" default="true"/>
|
||||
<arg name="main_camera" default="true"/>
|
||||
@@ -21,8 +21,9 @@
|
||||
<arg name="viz" value="$(arg viz)"/>
|
||||
</include>
|
||||
|
||||
<!-- web server -->
|
||||
<include file="$(find clever)/launch/web_server.launch" if="$(arg web_server)"/>
|
||||
|
||||
<!-- web server, serving /home/pi/catkin_ws/src/clever/clever/static -->
|
||||
<node name="web_server" pkg="clever" type="monkey" output="screen" if="$(arg web_server)"/>
|
||||
|
||||
<!-- web video server -->
|
||||
<node name="web_video_server" pkg="web_video_server" type="web_video_server" if="$(arg web_video_server)" required="false" respawn="true" respawn_delay="5"/>
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
<arg name="fcu_conn" value="udp"/>
|
||||
<arg name="fcu_ip" value="$(arg ip)"/>
|
||||
<arg name="gcs_bridge" value="false"/>
|
||||
<arg name="web_server" default="false"/>
|
||||
<arg name="web_video_server" default="false"/>
|
||||
<arg name="main_camera" default="false"/>
|
||||
<arg name="fpv_camera" default="false"/>
|
||||
<arg name="rosbridge" value="$(arg rosbridge)"/>
|
||||
<arg name="web_server" default="false"/>
|
||||
<arg name="aruco" default="false"/>
|
||||
</include>
|
||||
</launch>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<launch>
|
||||
<node name="web_server" pkg="clever" type="web_server.py" output="screen">
|
||||
<param name="path" value="$(find clever)/static"/>
|
||||
</node>
|
||||
</launch>
|
||||
3
clever/src/monkey
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
exec /home/pi/monkey/build/monkey --port 80
|
||||
@@ -27,7 +27,7 @@ def check_fcu():
|
||||
|
||||
def check_camera(name):
|
||||
try:
|
||||
rospy.wait_for_message(name + '/image_raw', Image, timeout=3)
|
||||
rospy.wait_for_message(name + '/image_raw', Image, timeout=1)
|
||||
except rospy.ROSException:
|
||||
raise Exception('No %s camera images' % name)
|
||||
try:
|
||||
@@ -37,7 +37,7 @@ def check_camera(name):
|
||||
|
||||
def check_aruco():
|
||||
try:
|
||||
rospy.wait_for_message('aruco_pose/debug', Image, timeout=3)
|
||||
rospy.wait_for_message('aruco_pose/debug', Image, timeout=1)
|
||||
except rospy.ROSException:
|
||||
raise Exception('No aruco_pose/debug topic')
|
||||
|
||||
@@ -53,21 +53,21 @@ def check_simpleoffboard():
|
||||
|
||||
def check_imu():
|
||||
try:
|
||||
rospy.wait_for_message('mavros/imu/data', Imu, timeout=3)
|
||||
rospy.wait_for_message('mavros/imu/data', Imu, timeout=1)
|
||||
except rospy.ROSException:
|
||||
raise Exception('No IMU data')
|
||||
|
||||
|
||||
def check_local_position():
|
||||
try:
|
||||
rospy.wait_for_message('mavros/local_position/pose', PoseStamped, timeout=3)
|
||||
rospy.wait_for_message('mavros/local_position/pose', PoseStamped, timeout=1)
|
||||
except rospy.ROSException:
|
||||
raise Exception('No local position')
|
||||
|
||||
|
||||
def check_velocity():
|
||||
try:
|
||||
velocity = rospy.wait_for_message('mavros/local_position/velocity', TwistStamped, timeout=3)
|
||||
velocity = rospy.wait_for_message('mavros/local_position/velocity', TwistStamped, timeout=1)
|
||||
horiz = math.hypot(velocity.twist.linear.x, velocity.twist.linear.y)
|
||||
vert = velocity.twist.linear.z
|
||||
if abs(horiz) > 0.1:
|
||||
@@ -89,7 +89,7 @@ def check(name, fn):
|
||||
try:
|
||||
fn()
|
||||
rospy.loginfo('%s: OK', name)
|
||||
except BaseException as e:
|
||||
except Exception as e:
|
||||
rospy.logwarn('%s: %s', name, str(e))
|
||||
|
||||
|
||||
|
||||
@@ -83,12 +83,13 @@ AUTO_ARM = AUTO_OFFBOARD and rospy.get_param('~auto_arm', True)
|
||||
OFFBOARD_TIMEOUT = rospy.Duration(rospy.get_param('~offboard_timeout', 3))
|
||||
ARM_TIMEOUT = rospy.Duration(rospy.get_param('~arm_timeout', 5))
|
||||
LOCAL_POSITION_TIMEOUT = rospy.Duration(rospy.get_param('~local_position_timeout', 0.5))
|
||||
NAVIGATE_AFTER_ARMED = rospy.Duration(rospy.get_param('~navigate_after_armed', False))
|
||||
NAVIGATE_AFTER_ARMED = rospy.Duration(rospy.get_param('~navigate_after_armed', True))
|
||||
TRANSFORM_TIMEOUT = rospy.Duration(rospy.get_param('~transform_timeout', 3))
|
||||
SETPOINT_RATE = rospy.get_param('~setpoint_rate', 30)
|
||||
LOCAL_FRAME = rospy.get_param('~local_frame', 'local_origin')
|
||||
LAND_MODE = rospy.get_param('~land_mode', 'AUTO.LAND')
|
||||
LAND_TIMEOUT = rospy.Duration(rospy.get_param('~land_timeout', 2))
|
||||
DEFAULT_SPEED = rospy.get_param('~default_speed', 0.5)
|
||||
|
||||
|
||||
def offboard_and_arm():
|
||||
@@ -164,7 +165,7 @@ def get_publisher_and_message(req, stamp, continued=True, update_frame=True):
|
||||
if update_frame:
|
||||
ps.header.frame_id = req.frame_id or LOCAL_FRAME
|
||||
ps.pose.position = Point(getattr(req, 'x', 0), getattr(req, 'y', 0), req.z)
|
||||
ps.pose.orientation = orientation_from_euler(0, 0, req.yaw)
|
||||
ps.pose.orientation = orientation_from_euler(0, 0, req.yaw, axes='sxyz')
|
||||
current_nav_finish = tf_buffer.transform(ps, LOCAL_FRAME, TRANSFORM_TIMEOUT)
|
||||
|
||||
if isinstance(req, srv.NavigateGlobalRequest):
|
||||
@@ -188,7 +189,7 @@ def get_publisher_and_message(req, stamp, continued=True, update_frame=True):
|
||||
PT.IGNORE_AFX + PT.IGNORE_AFY + PT.IGNORE_AFZ +
|
||||
(PT.IGNORE_YAW if yaw_rate_flag else PT.IGNORE_YAW_RATE),
|
||||
position=setpoint,
|
||||
yaw=euler_from_orientation(current_nav_finish.pose.orientation, 'szyx')[2] - math.pi / 2,
|
||||
yaw=euler_from_orientation(current_nav_finish.pose.orientation, 'sxyz')[2],
|
||||
yaw_rate=req.yaw_rate)
|
||||
return position_pub, msg
|
||||
|
||||
@@ -207,7 +208,7 @@ def get_publisher_and_message(req, stamp, continued=True, update_frame=True):
|
||||
PT.IGNORE_AFX + PT.IGNORE_AFY + PT.IGNORE_AFZ +
|
||||
(PT.IGNORE_YAW if yaw_rate_flag else PT.IGNORE_YAW_RATE),
|
||||
position=pose_local.pose.position,
|
||||
yaw=euler_from_orientation(pose_local.pose.orientation, 'szyx')[2] - math.pi / 2,
|
||||
yaw=euler_from_orientation(pose_local.pose.orientation, 'sxyz')[2],
|
||||
yaw_rate=req.yaw_rate)
|
||||
return position_pub, msg
|
||||
|
||||
@@ -225,7 +226,7 @@ def get_publisher_and_message(req, stamp, continued=True, update_frame=True):
|
||||
PT.IGNORE_AFX + PT.IGNORE_AFY + PT.IGNORE_AFZ +
|
||||
(PT.IGNORE_YAW if yaw_rate_flag else PT.IGNORE_YAW_RATE),
|
||||
velocity=vector_local.vector,
|
||||
yaw=euler_from_orientation(pose_local.pose.orientation, 'szyx')[2] - math.pi / 2,
|
||||
yaw=euler_from_orientation(pose_local.pose.orientation, 'sxyz')[2],
|
||||
yaw_rate=req.yaw_rate)
|
||||
return position_pub, msg
|
||||
|
||||
@@ -261,9 +262,12 @@ def handle(req):
|
||||
rospy.logwarn('No connection to the FCU')
|
||||
return {'message': 'No connection to the FCU'}
|
||||
|
||||
if isinstance(req, (srv.NavigateRequest, srv.NavigateGlobalRequest)) and req.speed <= 0:
|
||||
rospy.logwarn('Navigate speed must be greater than zero, %s passed')
|
||||
return {'message': 'Navigate speed must be greater than zero, %s passed' % req.speed}
|
||||
if isinstance(req, (srv.NavigateRequest, srv.NavigateGlobalRequest)):
|
||||
if req.speed < 0:
|
||||
rospy.logwarn('Navigate speed must be positive, %s passed')
|
||||
return {'message': 'Navigate speed must be positive, %s passed' % req.speed}
|
||||
elif req.speed == 0:
|
||||
req.speed = DEFAULT_SPEED
|
||||
|
||||
if isinstance(req, (srv.NavigateRequest, srv.NavigateGlobalRequest)) and \
|
||||
(pose is None or rospy.get_rostime() - pose.header.stamp > LOCAL_POSITION_TIMEOUT):
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import rospy
|
||||
import subprocess
|
||||
import re
|
||||
from flask import Flask, send_from_directory, send_file, request, jsonify
|
||||
|
||||
rospy.init_node('web_server', disable_signals=True)
|
||||
|
||||
port = rospy.get_param('~port', 7070)
|
||||
host = rospy.get_param('~host', '0.0.0.0')
|
||||
serve_path = rospy.get_param('~path')
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def serve_index():
|
||||
return send_from_directory(serve_path, 'index.html')
|
||||
|
||||
|
||||
@app.route('/<path:path>')
|
||||
def serve_static(path):
|
||||
print serve_path, path
|
||||
return send_from_directory(serve_path, path)
|
||||
|
||||
|
||||
@app.route('/wifi_data/')
|
||||
def get_wifi_data():
|
||||
cur_ip = request.remote_addr
|
||||
ip_signal = get_ip_signal()
|
||||
return jsonify({'ip': cur_ip, 'signal': ip_signal[cur_ip]}), 200
|
||||
|
||||
|
||||
def get_ip_signal():
|
||||
wlan_interface = 'wlan0'
|
||||
# Getting info about wifi client connected to access point. From here we know MAC and signal level
|
||||
iwl = subprocess.check_output(['sudo', 'iw', 'dev', 'wlan0', 'station', 'dump']).splitlines()
|
||||
mac_signal = {}
|
||||
cur_client = ''
|
||||
for line in iwl:
|
||||
if line.find('Station') != -1:
|
||||
cur_client = re.search(r'([0-9A-F]{2}[:-]){5}([0-9A-F]{2})', line, re.I).group()
|
||||
if line.find('signal') != -1:
|
||||
sg = re.search(r'(\[-?\d*\])', line, re.I).group()
|
||||
mac_signal[cur_client] = re.sub(r'[\[\]]', '', sg)
|
||||
ip_signal = {}
|
||||
# Getting ip-mac mapping
|
||||
ip_mac = subprocess.check_output(['arp', '-i', wlan_interface]).splitlines()
|
||||
for line in ip_mac:
|
||||
mac = re.search(r'([0-9A-F]{2}[:-]){5}([0-9A-F]{2})', line, re.I)
|
||||
if mac is not None:
|
||||
mac = mac.group()
|
||||
if mac in mac_signal:
|
||||
ips = re.search(r'((2[0-5]|1[0-9]|[0-9])?[0-9]\.){3}((2[0-5]|1[0-9]|[0-9])?[0-9])', line, re.I).group()
|
||||
ip_signal[ips] = mac_signal[mac]
|
||||
return ip_signal
|
||||
|
||||
|
||||
rospy.loginfo('Serving on %s:%s', host, port)
|
||||
app.run(host=host, port=port, threaded=True)
|
||||
12
clever/static/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<h1>CLEVER Drone Kit Tools</h1>
|
||||
|
||||
<ul>
|
||||
<!-- <li><a href="">View user reference</a> (<a href="http://clever.copterexpress.com">http://clever.copterexpress.com</a> snapshot)</li> -->
|
||||
<!-- <li><a href="">Go to web terminal</a> (<code>Butterfly</code>)</li> -->
|
||||
<li><a href="" id="wvs">View image topics</a> (<code>web_video_server</code>)</li>
|
||||
<!-- <li><a href="viz.html">View 3D visualization</a> (<code>ros3djs</code>)</li> -->
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript">
|
||||
document.querySelector("#wvs").href = location.origin + ':8080';
|
||||
</script>
|
||||
57
deploy/monkey
Normal file
@@ -0,0 +1,57 @@
|
||||
# Default Host - Configuration
|
||||
# ============================
|
||||
# Here the variable principals of the program are defined in respect
|
||||
# to the configuration of the different types of directives.
|
||||
|
||||
[HOST]
|
||||
# ServerName:
|
||||
# -----------
|
||||
# Allow you to set a host and domain name (e.g monkey.linuxchile.cl). If
|
||||
# you are working in a local network just set your IP address or if you
|
||||
# are working like localhost set your loopback address (127.0.0.1).
|
||||
|
||||
ServerName 0.0.0.0
|
||||
|
||||
# DocumentRoot:
|
||||
# -------------
|
||||
# This variable corresponds to the location of the main server directory
|
||||
# of the web pages, where the files of your site are located.
|
||||
#
|
||||
# Example:
|
||||
# DocumentRoot /home/krypton/htdocs
|
||||
|
||||
DocumentRoot /home/pi/catkin_ws/src/clever/clever/static
|
||||
|
||||
# Redirect:
|
||||
# ---------
|
||||
# Under specific conditions, you may want the server performs a HTTP
|
||||
# redirect when this Virtual Host is reach. If that is the case, append
|
||||
# to the Redirect key the value of the address where to redirect the
|
||||
# HTTP client.
|
||||
#
|
||||
# Redirect http://monkey-project.com
|
||||
|
||||
[LOGGER]
|
||||
# AccessLog:
|
||||
# ----------
|
||||
# Registration file of correct request.
|
||||
|
||||
AccessLog /home/pi/monkey/build/log/access.log
|
||||
|
||||
# ErrorLog:
|
||||
# ---------
|
||||
# Registration file of incorrect request.
|
||||
|
||||
ErrorLog /home/pi/monkey/build/log/error.log
|
||||
|
||||
[ERROR_PAGES]
|
||||
404 404.html
|
||||
|
||||
[HANDLERS]
|
||||
# FastCGI
|
||||
# =======
|
||||
# Match /.*\.php fastcgi
|
||||
|
||||
# CGI
|
||||
# ===
|
||||
# Match /cgi-bin/.*\.cgi cgi
|
||||
@@ -160,7 +160,7 @@ navigate(x=3, y=2, z=2, speed=1, frame_id='aruco_map', update_frame=True)
|
||||
Вращение на месте со скоростью 0.5 рад/c (против часовой):
|
||||
|
||||
```python
|
||||
navigate(x=0, y=0, z=0, speed=1, yaw=float('nan'), yaw_rate=0.5, frame_id='fcu_horiz')
|
||||
navigate(x=0, y=0, z=0, yaw=float('nan'), yaw_rate=0.5, frame_id='fcu_horiz')
|
||||
```
|
||||
|
||||
Полет вперед 3 метра со скоростью 0.5 м/с, вращаясь по рысканью со скоростью 0.2 рад/с:
|
||||
|
||||
@@ -28,4 +28,11 @@ echo "$1" >> /etc/clever_version
|
||||
# Origin image file name
|
||||
echo "${2%.*}" >> /etc/clever_origin
|
||||
|
||||
echo -e "\033[0;31m\033[1m$(date) | #3 End initialisation of image\033[0m\033[0m"
|
||||
|
||||
echo -e "\033[0;31m\033[1m$(date) | #3 Set max space for syslogs\033[0m\033[0m"
|
||||
|
||||
# https://unix.stackexchange.com/questions/139513/how-to-clear-journalctl
|
||||
sed -i 's/#SystemMaxUse=/SystemMaxUse=200M/' /etc/systemd/journald.conf
|
||||
|
||||
|
||||
echo -e "\033[0;31m\033[1m$(date) | #4 End initialisation of image\033[0m\033[0m"
|
||||
|
||||
@@ -28,7 +28,19 @@ apt-get install --no-install-recommends -y \
|
||||
libjpeg8-dev=8d1-2 \
|
||||
tcpdump \
|
||||
libpoco-dev=1.7.6+dfsg1-5+deb9u1
|
||||
|
||||
|
||||
# install Monkey web-server
|
||||
cd /home/pi
|
||||
git clone git@github.com:monkey/monkey.git
|
||||
cd monkey
|
||||
git checkout v1.6.9
|
||||
./configure --malloc-libc --local
|
||||
make
|
||||
sudo setcap 'cap_net_bind_service=+ep' ./build/monkey # allow using 80 port
|
||||
rm build/conf/sites/default
|
||||
ln -s /home/pi/catkin_ws/src/clever/deploy/monkey ./build/conf/sites/default
|
||||
cd /home/pi
|
||||
|
||||
echo -e "\033[0;31m\033[1m$(date) | #2 Adding mjpg-streamer at /home/pi\033[0m\033[0m"
|
||||
# https://github.com/jacksonliam/mjpg-streamer
|
||||
|
||||
@@ -38,11 +50,17 @@ git clone https://github.com/jacksonliam/mjpg-streamer.git /home/pi/mjpg-streame
|
||||
&& make install \
|
||||
&& chown -Rf pi:pi /home/pi/mjpg-streamer
|
||||
|
||||
echo -e "\033[0;31m\033[1m$(date) | Add .vimrc\033[0m\033[0m"
|
||||
echo -e "\033[0;31m\033[1m$(date) | Miscellaneous\033[0m\033[0m"
|
||||
|
||||
# vim settings
|
||||
echo "set mouse-=a
|
||||
syntax on
|
||||
" > /home/pi/.vimrc
|
||||
|
||||
# disable some auto-updating
|
||||
sudo systemctl disable apt-daily.service
|
||||
sudo systemctl disable apt-daily.timer
|
||||
sudo systemctl disable apt-daily-upgrade.timer
|
||||
sudo systemctl disable apt-daily-upgrade.service
|
||||
|
||||
echo -e "\033[0;31m\033[1m$(date) | End of network installation\033[0m\033[0m"
|
||||
|
||||