Skip to content

Commit

Permalink
update cyphal_application submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
PonomarevDA committed Nov 27, 2023
1 parent 796b8ba commit d0cb31d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 32 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ else()
)
endif()

# set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Werror -std=c++17")
set(CYPHAL_REPO_DIR ${CMAKE_CURRENT_LIST_DIR}/Libs/cyphal_application)
set(PLATFORM socketcan)
Expand Down Expand Up @@ -61,6 +62,17 @@ if(NOT DEFINED ARDUPILOT_JSON_SIM_INTERFACE)
)
endif()

execute_process(
COMMAND git rev-parse --short=16 HEAD
COMMAND_ERROR_IS_FATAL ANY
OUTPUT_VARIABLE GIT_HASH_64_BIT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if("GIT_HASH_64_BIT" STREQUAL "")
set(GIT_HASH_64_BIT "BADC0FFEEFFF")
endif()
set(GIT_HASH "0x${GIT_HASH_64_BIT}")
add_definitions(-DGIT_HASH=${GIT_HASH})

# Generate DSDL when build
add_custom_target(
Expand Down
2 changes: 1 addition & 1 deletion Libs/cyphal_application
Submodule cyphal_application updated 50 files
+4 −1 .gitignore
+3 −3 CMakeLists.txt
+1 −7 Cyphal/algorithms.cpp
+1 −7 Cyphal/algorithms.hpp
+4 −0 Cyphal/cyphal.cpp
+10 −3 Cyphal/cyphal.hpp
+5 −7 Cyphal/cyphal_publishers.cpp
+4 −6 Cyphal/cyphal_publishers.hpp
+5 −7 Cyphal/cyphal_registers.cpp
+3 −6 Cyphal/cyphal_registers.hpp
+4 −9 Cyphal/cyphal_subscribers.cpp
+5 −7 Cyphal/cyphal_subscribers.hpp
+5 −7 Cyphal/cyphal_transport_can.hpp
+2 −8 Libs/libcanard/libcanard/_canard_cavl.h
+28 −23 Libs/libcanard/libcanard/canard.cpp
+2 −6 Libs/libcanard/libcanard/canard.h
+13 −9 Libs/platform_specific_components/socketcan/libcanard/src/socketcan.cpp
+2 −6 Libs/platform_specific_components/socketcan/libcanard/src/socketcan.h
+1 −1 Libs/platform_specific_components/stm32/libcanard/bxcan/src/bxcan.c
+43 −17 README.md
+4 −0 Udral/actuator.cpp
+3 −0 Udral/actuator.hpp
+4 −0 Udral/airspeed.cpp
+3 −0 Udral/airspeed.hpp
+4 −4 Udral/barometer.cpp
+4 −0 Udral/barometer.hpp
+4 −0 Udral/battery.cpp
+4 −0 Udral/battery.hpp
+27 −0 Udral/circuit_status.cpp
+26 −0 Udral/circuit_status.hpp
+4 −0 Udral/gnss.cpp
+4 −0 Udral/gnss.hpp
+4 −0 Udral/imu.cpp
+4 −0 Udral/imu.hpp
+4 −0 Udral/magnetometer.cpp
+4 −0 Udral/magnetometer.hpp
+4 −0 Udral/rangefinder.cpp
+3 −1 Udral/rangefinder.hpp
+4 −0 Udral/rgbled.cpp
+3 −0 Udral/rgbled.hpp
+4 −0 ds015/gnss.cpp
+3 −0 ds015/gnss.hpp
+0 −10 examples/git_hash.h
+9 −0 examples/ubuntu_minimal/CMakeLists.txt
+4 −4 examples/ubuntu_minimal/main.cpp
+9 −0 examples/ubuntu_publisher_example/CMakeLists.txt
+3 −3 examples/ubuntu_publisher_example/application.hpp
+3 −0 platform_specific/bxcan/cyphal_transport_can.cpp
+27 −15 platform_specific/fdcan/cyphal_transport_can.cpp
+4 −0 platform_specific/socketcan/cyphal_transport_can.cpp
1 change: 1 addition & 0 deletions scripts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ COPY package.xml package.xml
COPY src/ src/
COPY compile_dsdl.sh compile_dsdl.sh
COPY Libs/ Libs/
COPY .git/ .git/

# 4. Build ROS
RUN ./Libs/cyphal_application/scripts/nnvg_generate_c_headers.sh
Expand Down
4 changes: 2 additions & 2 deletions src/autopilot_interface/cyphal_hitl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ void CyphalHitlInterface::publish_esc_feedback(uint8_t esc_idx, float voltage, f
return;
}

ZubaxCompactFeedback feedback;
cyphal::ZubaxCompactFeedback feedback;
feedback.dc_voltage = std::round(voltage * 5.0f);
feedback.dc_current = std::round(current * 5.0f);
feedback.velocity = rpm * ZubaxCompactFeedbackPublisher::RPM_TO_RAD_PER_SEC;
feedback.velocity = rpm * cyphal::ZubaxCompactFeedbackPublisher::RPM_TO_RAD_PER_SEC;

esc_feedback[esc_idx]->publish(feedback);
}
Expand Down
58 changes: 29 additions & 29 deletions src/autopilot_interface/cyphal_hitl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,35 +67,35 @@ class CyphalHitlInterface {
private:
void _update_port_identifiers();

Cyphal cyphal;

SetpointSubscriber setpoint;
ReadinessSubscriber readiness;
HighColorSubscriber rgbled;
ZubaxCompactFeedbackPublisher esc_feedback_0;
ZubaxCompactFeedbackPublisher esc_feedback_1;
ZubaxCompactFeedbackPublisher esc_feedback_2;
ZubaxCompactFeedbackPublisher esc_feedback_3;
std::array<ZubaxCompactFeedbackPublisher*, 4> esc_feedback;

GpsPointPublisher gps_point;
Int16Publisher gps_sats;
Int16Publisher gps_status;
Int16Publisher gps_pdop;

BaroPressurePublisher baro_pressure;
BaroTemperaturePublisher baro_temperature;

MagneticFieldPublisher magnetometer;

ImuAccelPublisher accel;
ImuGyroPublisher gyro;
RawImuPublisher imu;

DiffPressurePublisher diff_pressure_0;
DiffPressurePublisher diff_pressure_1;
RangefinderRangePublisher rangefinder;
UdralBatteryPublisher battery;
cyphal::Cyphal cyphal;

cyphal::SetpointSubscriber setpoint;
cyphal::ReadinessSubscriber readiness;
cyphal::HighColorSubscriber rgbled;
cyphal::ZubaxCompactFeedbackPublisher esc_feedback_0;
cyphal::ZubaxCompactFeedbackPublisher esc_feedback_1;
cyphal::ZubaxCompactFeedbackPublisher esc_feedback_2;
cyphal::ZubaxCompactFeedbackPublisher esc_feedback_3;
std::array<cyphal::ZubaxCompactFeedbackPublisher*, 4> esc_feedback;

cyphal::GpsPointPublisher gps_point;
cyphal::Int16Publisher gps_sats;
cyphal::Int16Publisher gps_status;
cyphal::Int16Publisher gps_pdop;

cyphal::BaroPressurePublisher baro_pressure;
cyphal::BaroTemperaturePublisher baro_temperature;

cyphal::MagneticFieldPublisher magnetometer;

cyphal::ImuAccelPublisher accel;
cyphal::ImuGyroPublisher gyro;
cyphal::RawImuPublisher imu;

cyphal::DiffPressurePublisher diff_pressure_0;
cyphal::DiffPressurePublisher diff_pressure_1;
cyphal::RangefinderRangePublisher rangefinder;
cyphal::UdralBatteryPublisher battery;

double _time_factor{1.0};
};
Expand Down

0 comments on commit d0cb31d

Please sign in to comment.