This directory contains code for the aerial experiments, including:
rnw_ros
andrnw_msgs
are specific to rock-and-walk.uwb_mocap_broadcast
for transmitting mocap information.djiros
andn3ctrl
for the underlying quadrotor control
Hardware Requirements
- DJI N3 Flight Controller
- DJI Manifold 2-G Onboard Computer
- OptiTrack Motion Capture System
- 2 x Nooploop UWB Transmitter
- Logitech F710 Wireless Gamepad
- Custom end-effector for aerial rock-and-walk
Run as hardware-in-the-loop (HIL) simulation
- Connect DJI N3 Autopilot to a PC/Mac with DJI Assistant installed
- Enter simulation in DJI Assistant
roslaunch rnw_ros sim.launch
UWB Config Channel #9 is Drone #1 Channel #4 is Drone #2
Run real experiments
- Open OptiTrack
roslaunch rnw_ros ground_station.launch
on ground station i.e. your laptop- SSH into the aircraft and
roslaunch rnw_ros real.launch
Pre-Flight Checklist
Make sure UAV odometry is correct
- Fly it using
real.launch
, hover and moving around
Make sure ConeState
is correct
- Calibrate the center point and tip point using
roslaunch rnw_ros mocap_calib.launch
- Calibrate
ground_z
by placing a marker on the ground - Run
roslaunch rnw_ros check_cone_state.launch
, check the cone state visually - Check the estimated radius and the true radius, make sure they mactch.
Make sure GripState
is correct
- Calibrate
flu_T_tcp
usingroslaunch rnw_ros mocap_calib.launch
- Run
roslaunch rnw_ros check_grip_state.launch
, see does it make sense intuitively. - Move the quadrotor along cone's shaft, see is the estimated
grip_depth
correct, adjustflu_T_tcp
to makegrip_depth
match reality.
Make sure rock-and-walk planning is correct
- make sure
ConeState
andGripState
are correct following the instructions above - run
roslaunch rnw_ros check_rnw_planning.launch
Control Flow
-
rnw_controller_node
sends trajectory tornw_traj_server_node
-
rnw_traj_server_node
transform the trajectory into position command, send ton3ctrl_node
-
n3ctrl_node
performs position control, sends attitude and trust commands todjiros_node
State Flow
-
OptiTrack sends out mocap for the aircraft and object through Ethernet.
-
ground_station.launch
receives mocap from Ethernet and sends odometry to the onboard computer through UWB. -
uart_odom
receives odometry from the ground station, then publish to ROS -
pub_cone_state_node
reads odometry and configuration files, calculatecone_state
, then publish to ROS -
rnw_controller_node
readcone_state
, and performs rock-and-walk.
Playback
rosbag record -a
is called by default, the .bag
files can be retrieved after flight.
Inspect them using:
playback.launch
will replay the experiments in RViz.- PlotJuggler
- MATLAB
/drone1
/drone1/odom
/drone1/traj
/drone1/position_cmd
/drone1/state
/drone2
/drone2/odom
/drone2/traj
/drone2/position_cmd
/drone2/state
/cone
/cone/odom
/cone/state
/rnw
/rnw/start
/rnw/state
swarm_planner_node
takes all /droneX/odom
, and sets all /droneX/traj
traj_server_node
takes /drone1/traj
and sets /drone1/position_cmd
uwb_transceiver
takes /drone1/odom
and /done1/position_cmd
and send it to the drone
/odom/uav
/position_cmd
/djiros/rc
uwb_transceiver
sets /odom/uav
and /position_cmd
n3ctrl
executes /position_cmd
while monitoring /uav/odom
and /djiros/rc
In motion capture volumn, the max height drones can safely fly is
placement
cone tip points out
left: drone1
right: drone2
step_direction
value range:
take
heavy object tip over at 25
steel object gain 60
exp9 for 45 120 exp8 for 45 90