This directory contains code for the aerial experiments, including:
rnw_rosandrnw_msgsare specific to rock-and-walk.uwb_mocap_broadcastfor transmitting mocap information.djirosandn3ctrlfor 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.launchon 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_zby 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_tcpusingroslaunch 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_depthcorrect, adjustflu_T_tcpto makegrip_depthmatch reality.
Make sure rock-and-walk planning is correct
- make sure
ConeStateandGripStateare correct following the instructions above - run
roslaunch rnw_ros check_rnw_planning.launch
Control Flow
-
rnw_controller_nodesends trajectory tornw_traj_server_node -
rnw_traj_server_nodetransform the trajectory into position command, send ton3ctrl_node -
n3ctrl_nodeperforms position control, sends attitude and trust commands todjiros_node
State Flow
-
OptiTrack sends out mocap for the aircraft and object through Ethernet.
-
ground_station.launchreceives mocap from Ethernet and sends odometry to the onboard computer through UWB. -
uart_odomreceives odometry from the ground station, then publish to ROS -
pub_cone_state_nodereads odometry and configuration files, calculatecone_state, then publish to ROS -
rnw_controller_nodereadcone_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.launchwill 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