Generic ROS based drone flight stack for the Pika Spark.
Note: Don't forget to install the dependencies (see at the end of this file).
Removed these dependencies for now...
- See the detailed build instructions.
cd colcon_ws
. install/setup.bash
ros2 launch viper [launch-file.py]viper-quad.py- run the flight controller node directly on the Pika Spark hardware.viper-sim.py- run Gazebo simulation locally with thevipernode,joy,teleop_twist_joy, andros_gz_bridge. More details on Gazebo implementation here.viper-cosim.py- co-simulation setup that runs the joystick/Gazebo side locally while the flight controller remains on the Pika Spark.
A CAN interface must be set up by running the relevant script before the flight controller node is run. There are 2 options:
-
vcan: Setup by runningsetup_vcan.shinscriptsdirectory -
can: This can be the physical interface on Pika Spark (setup_can.sh) orslcan(source setup_yakut_slcan.sh) on host PC. Scripts register undercanfor simplicity. For more details on which script to run, see here.If you use the Zubax Babel as a USB-CAN device you need to run
. setup_yakut_slcan.shfirst.
| Default name | Type | Description |
|---|---|---|
/viper/motor_speed |
actuator_msgs/Actuators |
Motor command output published for Gazebo/ros_gz_bridge. Same as what is being sent over Cyphal |
| Topic name | Type | Description |
|---|---|---|
/viper/cmd_vel |
geometry_msgs/Twist |
Teleop command input topic. |
/viper/joy |
sensor_msgs/Joy |
Reads raw joystick input used to arm/disarm and read controller axes/buttons. |
/imu |
sensor_msgs/Imu |
IMU measurements consumed by the estimator. External BNO085 ROS 2 node. |
/parameter_events |
rcl_interfaces/ParameterEvent |
Parameter change notifications for dynamic reconfiguration. |
| Name | Default | Description |
|---|---|---|
can_iface |
can0 |
CAN interface device used by the flight controller. |
can_node_id |
100 |
CAN node ID for the Pika Spark on the CAN bus. |
enable_button |
0 |
Index of the joystick button used to arm/disarm the motors. |
teleop_topic |
cmd_vel |
Topic name used for teleoperation Twist commands. |
teleop_topic_deadline_ms |
100 | Deadline in milliseconds within which a teleop message is expected. |
teleop_topic_liveliness_lease_duration |
1000 | Liveliness lease duration for teleop command publishing. |
imu_topic |
imu |
Topic name used for IMU messages consumed by the estimator. |
imu_topic_deadline_ms |
100 | Deadline in milliseconds within which an IMU message is expected. |
imu_topic_liveliness_lease_duration |
1000 | Liveliness lease duration for IMU message publishing. |
attitude_roll_p |
6.0 |
Attitude controller roll proportional gain. |
attitude_roll_i |
0.01 |
Attitude controller roll integral gain. |
attitude_roll_d |
0.001 |
Attitude controller roll derivative gain. |
attitude_pitch_p |
6.0 |
Attitude controller pitch proportional gain. |
attitude_pitch_i |
0.01 |
Attitude controller pitch integral gain. |
attitude_pitch_d |
0.001 |
Attitude controller pitch derivative gain. |
attitude_yaw_p |
0.5 |
Attitude controller yaw proportional gain. |
attitude_yaw_i |
0.05 |
Attitude controller yaw integral gain. |
attitude_yaw_d |
0.001 |
Attitude controller yaw derivative gain. |
acro_mode |
false |
Enable acro-style rate control instead of attitude stabilization. |
rate_roll_p |
0.05 |
Rate controller roll proportional gain. |
rate_roll_i |
0.2 |
Rate controller roll integral gain. |
rate_roll_d |
0.001 |
Rate controller roll derivative gain. |
rate_pitch_p |
0.35 |
Rate controller pitch proportional gain. |
rate_pitch_i |
0.4 |
Rate controller pitch integral gain. |
rate_pitch_d |
0.005 |
Rate controller pitch derivative gain. |
rate_yaw_p |
0.5 |
Rate controller yaw proportional gain. |
rate_yaw_i |
0.05 |
Rate controller yaw integral gain. |
rate_yaw_d |
0.001 |
Rate controller yaw derivative gain. |
rate_integral_windup |
0.3 |
Integral windup limit for rate controllers. |
rate_derivative_filter_alpha |
0.2 |
Derivative filter alpha used by the rate controllers. |
max_tilt_angle |
0.261799 |
Maximum tilt angle in radians (default 15°). |
Only needed if want to re-add mp-units dependency. It's removed for now.
- Install
gsl-lite
git clone https://github.com/gsl-lite/gsl-lite && cd gsl-lite
mkdir build && cd build
cmake .. && make -j8
sudo make install- Install
Catch2
git clone https://github.com/catchorg/Catch2 && cd Catch2
mkdir build && cd build
cmake .. && make -j8
sudo make install- Install
fmt
git clone https://github.com/fmtlib/fmt && cd fmt
mkdir build && cd build
cmake -DFMT_TEST=OFF ..
make -j8
sudo make install
