Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
PonomarevDA committed Sep 25, 2023
1 parent 7abbb0e commit a879bcc
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 31 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ COPY catkin_build.sh catkin_build.sh
COPY uav_dynamics/inno_vtol_dynamics/libs uav_dynamics/inno_vtol_dynamics/libs
COPY uav_dynamics/inno_vtol_dynamics/meshes uav_dynamics/inno_vtol_dynamics/meshes
COPY uav_dynamics/inno_vtol_dynamics/src uav_dynamics/inno_vtol_dynamics/src
COPY uav_dynamics/inno_vtol_dynamics/tests uav_dynamics/inno_vtol_dynamics/tests
COPY uav_dynamics/inno_vtol_dynamics/urdf uav_dynamics/inno_vtol_dynamics/urdf
COPY uav_dynamics/inno_vtol_dynamics/CMakeLists.txt uav_dynamics/inno_vtol_dynamics/CMakeLists.txt
COPY uav_dynamics/inno_vtol_dynamics/package.xml uav_dynamics/inno_vtol_dynamics/package.xml
Expand Down
9 changes: 9 additions & 0 deletions configs/px4/v1.14/standard_vtol/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Configs

## Airframe

<img src="https://docs.px4.io/main/assets/img/VTOLPlane.2ffc44a4.svg" alt="drawing" width="240"/>

## Actuators Setup

<img src="https://raw.githubusercontent.com/RaccoonlabDev/innopolis_vtol_dynamics/docs/assets/configs/px4_v1.14_standard_vtol.png" alt="drawing" width="480"/>
14 changes: 14 additions & 0 deletions configs/px4/v1.14/standard_vtol/airframe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SYS_AUTOSTART: 13000
SYS_CTRL_ALLOC: 1

# For DroneCAN
UAVCAN_EC_FUNC1: 101 # motor 1
UAVCAN_EC_FUNC2: 102 # motor 2
UAVCAN_EC_FUNC3: 103 # motor 3
UAVCAN_EC_FUNC4: 104 # motor 4
UAVCAN_EC_FUNC5: 105 # motor 5

UAVCAN_SV_FUNC1: 201 # servo 1 (left aileron)
UAVCAN_SV_FUNC2: 202 # servo 2 (right aileron)
UAVCAN_SV_FUNC3: 203 # servo 3 (elevators)
UAVCAN_SV_FUNC4: 204 # servo 4 (rudders)
1 change: 1 addition & 0 deletions configs/px4_dronecan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ UAVCAN_SUB_ICE: 1
UAVCAN_SUB_IMU: 1
UAVCAN_SUB_MAG: 1
UAVCAN_SUB_RNG: 1
UAVCAN_PUB_ARM: 1

# 2. Sensor calibration
# bus=ID%8, node_id=((ID/256)%256), devtype=ID/65536
Expand Down
13 changes: 0 additions & 13 deletions configs/px4_v1.14_vtol_airframe.yaml

This file was deleted.

16 changes: 13 additions & 3 deletions scripts/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,22 @@ configure_px4_v1_14_dronecan_quadrotor() {
${REPOSITORY_DIR}/configs/px4_common.yaml
}

configure_px4_v1_12_dronecan_vtol() {
px4_v1_12_1_dronecan_vtol() {
wget -O $DOWNLOADED_BINARY_PATH $PX4_V1_12_1_DRONECAN_URL
autopilot-configurator -v --firmware $DOWNLOADED_BINARY_PATH -f --config \
${REPOSITORY_DIR}/configs/px4_v1.13_inno_vtol_airframe.yaml \
${REPOSITORY_DIR}/configs/px4_dronecan.yaml \
${REPOSITORY_DIR}/configs/px4_common.yaml
}

px4_v1_14_0_beta_dronecan_vtol() {
wget -O $DOWNLOADED_BINARY_PATH $PX4_V1_14_0_BETA_DRONECAN_URL
autopilot-configurator -v --firmware $DOWNLOADED_BINARY_PATH -f --config \
${REPOSITORY_DIR}/configs/px4/v1.14/standard_vtol/airframe.yaml \
${REPOSITORY_DIR}/configs/px4_dronecan.yaml \
${REPOSITORY_DIR}/configs/px4_common.yaml
}

if [ -z $1 ]; then
printf "$RED$SCRIPT_NAME ERROR (line ${LINENO}): Argument is not specified!$NC\n"
exit 1
Expand Down Expand Up @@ -83,8 +91,10 @@ elif [[ $1 == "cyphal_octorotor" ]]; then
configure_px4_v1_14_cyphal_octorotor
elif [[ $1 == "dronecan_quadrotor" ]]; then
configure_px4_v1_14_dronecan_quadrotor
elif [[ $1 == "dronecan_vtol" ]]; then
configure_px4_v1_12_dronecan_vtol
elif [[ $1 == "px4_v1_12_1_dronecan_vtol" ]]; then
px4_v1_12_1_dronecan_vtol
elif [[ $1 == "px4_v1_14_0_beta_dronecan_vtol" ]]; then
px4_v1_14_0_beta_dronecan_vtol
else
printf "$RED$SCRIPT_NAME ERROR (line ${LINENO}): Unknown argument: '$1' $NC\n"
exit 1
Expand Down
24 changes: 18 additions & 6 deletions scripts/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ Supported modes (with aliases):
-------------------------------------------------------------------------------
cyphal_quadrotor,cq | Cyphal PX4 v1.14-beta Quadrotor x (4001)
dronecan_quadrotor,dq | DroneCAN PX4 v1.14-beta Quadrotor (4001)
dronecan_vtol,dv | DroneCAN PX4 v1.12 inno_vtol
dronecan_vtol_v1_12_1,dvo | DroneCAN PX4 v1.12 vtol 13070
-------------------------------------------------------------------------------
dronecan_vtol_v1_14_0,dv | DroneCAN PX4 v1.14-beta Standard VTOL (13000)
cyphal_standard_vtol,csv | Cyphal PX4 v1.14-beta Standard VTOL (13000)
cyphal_octorotor,co | Cyphal PX4 v1.14-beta Octorotor Coaxial (12001)
sitl_inno_vtol | MAVLink PX4 v1.12 inno_vtol
sitl_inno_vtol | MAVLink PX4 v1.12 vtol 13070
sitl_flight_goggles | MAVLink PX4 v1.12 Quadrotor (4001)
cyphal_and_dronecan | 2 CAN AP v4.4.0 Copter
-------------------------------------------------------------------------------
Expand Down Expand Up @@ -121,11 +122,20 @@ push_docker_image() {
docker push $IMAGE_NAME
}

dronecan_vtol() {
dronecan_vtol_v1_12_1() {
kill_all_related_containers
setup_dronecan_hitl_config
if [[ $OPTIONS == "--force" ]]; then
./configure.sh dronecan_vtol
./configure.sh px4_v1_12_1_dronecan_vtol
fi
docker container run --rm $DOCKER_FLAGS $IMAGE_NAME ./scripts/run_sim.sh dronecan_inno_vtol
}

dronecan_vtol_v1_14_0() {
kill_all_related_containers
setup_dronecan_hitl_config
if [[ $OPTIONS == "--force" ]]; then
./configure.sh px4_v1_14_0_beta_dronecan_vtol
fi
docker container run --rm $DOCKER_FLAGS $IMAGE_NAME ./scripts/run_sim.sh dronecan_inno_vtol
}
Expand Down Expand Up @@ -214,8 +224,10 @@ elif [ "$1" = "pull" ]; then
pull_docker_image
elif [ "$1" = "push" ]; then
push_docker_image
elif [ "$1" = "dronecan_vtol" ] || [ "$1" = "dv" ]; then
dronecan_vtol
elif [ "$1" = "dronecan_vtol_v1_12_1" ] || [ "$1" = "dvo" ]; then
dronecan_vtol_v1_12_1
elif [ "$1" = "dronecan_vtol_v1_14_0" ] || [ "$1" = "dv" ]; then
dronecan_vtol_v1_14_0
elif [ "$1" = "dronecan_quadrotor" ] || [ "$1" = "dq" ]; then
dronecan_quadrotor
elif [ "$1" = "sitl_inno_vtol" ]; then
Expand Down
14 changes: 7 additions & 7 deletions scripts/run_sim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ dronecan_inno_vtol() {
run_dronecan_communicator:=true \
vehicle:=innopolis_vtol \
vehicle_params:=vtol_params \
mixer:=inno_vtol_mixer \
dynamics:=inno_vtol
mixer:=px4_v1_14_0_vtol_13000_mixer \
dynamics:=vtol_dynamics
}

dronecan_flight_goggles() {
Expand Down Expand Up @@ -139,7 +139,7 @@ cyphal_standard_vtol() {
vehicle:=innopolis_vtol \
vehicle_params:=vtol_params \
mixer:=direct_mixer \
dynamics:=inno_vtol
dynamics:=vtol_dynamics
}

cyphal_and_dronecan_inno_vtol() {
Expand All @@ -160,8 +160,8 @@ sitl_inno_vtol() {
roslaunch innopolis_vtol_dynamics sitl.launch \
vehicle:=innopolis_vtol \
vehicle_params:=vtol_params \
mixer:=inno_vtol_mixer \
dynamics:=inno_vtol \
mixer:=vtol_13070_mixer \
dynamics:=vtol_dynamics \
run_sitl_flight_stack:="false"
}

Expand All @@ -181,8 +181,8 @@ sitl_inno_vtol_with_flight_stack() {
roslaunch innopolis_vtol_dynamics sitl.launch \
vehicle:=innopolis_vtol \
vehicle_params:=quadrotor_params \
mixer:=inno_vtol_mixer \
dynamics:=inno_vtol \
mixer:=vtol_13070_mixer \
dynamics:=vtol_dynamics \
run_sitl_flight_stack:="true"
}

Expand Down
2 changes: 1 addition & 1 deletion uav_dynamics/inno_vtol_dynamics

0 comments on commit a879bcc

Please sign in to comment.