mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 11:43:25 +00:00
Merge branch 'master' into 22-armhf
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<arg name="rangefinder_vl53l1x" default="true"/>
|
||||
<arg name="led" default="true"/>
|
||||
<arg name="blocks" default="false"/>
|
||||
<arg name="rc" default="true"/>
|
||||
<arg name="rc" default="false"/>
|
||||
|
||||
<arg name="simulator" default="false"/> <!-- flag that we are operating on a simulated drone -->
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<arg name="distance_sensor_remap" default="rangefinder/range"/>
|
||||
<arg name="usb_device" default="/dev/px4fmu"/>
|
||||
<arg name="prefix" default="" unless="$(eval fcu_conn == 'usb')"/>
|
||||
<arg name="prefix" default="bash -c 'while [ ! -e $(arg usb_device) ]; do sleep 1; done; $0 $@'" if="$(eval fcu_conn == 'usb')"/>
|
||||
<arg name="prefix" default="rosrun clover waitfile $(arg usb_device)" if="$(eval fcu_conn == 'usb')"/>
|
||||
|
||||
<node pkg="mavros" type="mavros_node" name="mavros" launch-prefix="$(arg prefix)" required="false" clear_params="true" respawn="$(arg respawn)" unless="$(eval fcu_conn == 'none')" respawn_delay="1" output="screen">
|
||||
<!-- UART connection -->
|
||||
|
||||
@@ -207,7 +207,7 @@ private:
|
||||
} catch (const tf2::TransformException& e) {
|
||||
// Invalidate previous frame
|
||||
prev_.release();
|
||||
return;
|
||||
goto publish_debug;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,6 +219,10 @@ private:
|
||||
flow_.quality = (uint8_t)(response * 255);
|
||||
flow_pub_.publish(flow_);
|
||||
|
||||
prev_ = curr_.clone();
|
||||
prev_stamp_ = msg->header.stamp;
|
||||
|
||||
publish_debug:
|
||||
// Publish debug image
|
||||
if (img_pub_.getNumSubscribers() > 0) {
|
||||
// publish debug image
|
||||
@@ -235,12 +239,9 @@ private:
|
||||
static geometry_msgs::TwistStamped velo;
|
||||
velo.header.stamp = msg->header.stamp;
|
||||
velo.header.frame_id = fcu_frame_id_;
|
||||
velo.twist.angular.x = flow_.integrated_x / integration_time.toSec();
|
||||
velo.twist.angular.y = flow_.integrated_y / integration_time.toSec();
|
||||
velo.twist.angular.x = flow_fcu.vector.x / integration_time.toSec();
|
||||
velo.twist.angular.y = flow_fcu.vector.y / integration_time.toSec();
|
||||
velo_pub_.publish(velo);
|
||||
|
||||
prev_ = curr_.clone();
|
||||
prev_stamp_ = msg->header.stamp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
clover/src/waitfile
Executable file
9
clover/src/waitfile
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# $ ./waitfile <file> <command> <args...>
|
||||
# wait until <file> appears and then invoke <command> with <args>
|
||||
|
||||
echo "wait for file $1"
|
||||
while [ ! -e "$1" ]; do sleep 1; done;
|
||||
echo "file $1 appeared"
|
||||
"${@:2}"
|
||||
Reference in New Issue
Block a user