34 element.setAttribute(name, value ?
"true" :
"false");
47 p_elem.setAttribute(
"start", std::to_string(
period.start));
62 if (
p.sim_sampling_rate != 1000.0)
74 if (
p.oversample_ratio != 1)
85 origin.setAttribute(
"latitude", std::to_string(
p.origin_latitude));
86 origin.setAttribute(
"longitude", std::to_string(
p.origin_longitude));
87 origin.setAttribute(
"altitude", std::to_string(
p.origin_altitude));
90 switch (
p.coordinate_frame)
93 cs.setAttribute(
"frame",
"ENU");
96 cs.setAttribute(
"frame",
"UTM");
97 cs.setAttribute(
"zone", std::to_string(
p.utm_zone));
98 cs.setAttribute(
"hemisphere",
p.utm_north_hemisphere ?
"N" :
"S");
101 cs.setAttribute(
"frame",
"ECEF");
125 if (std::abs(fmcw->getStartFrequencyOffset()) >
EPSILON)
129 if (fmcw->getChirpCount().has_value())
139 if (std::abs(triangle->getStartFrequencyOffset()) >
EPSILON)
143 if (triangle->getTriangleCount().has_value())
162 if (
const auto val =
timing.getFreqOffset())
166 if (
const auto val =
timing.getRandomFreqOffsetStdev())
170 if (
const auto val =
timing.getPhaseOffset())
174 if (
const auto val =
timing.getRandomPhaseOffsetStdev())
181 for (
size_t i = 0; i <
alphas.size(); ++i)
195 parent.setAttribute(
"pattern",
"sinc");
202 parent.setAttribute(
"pattern",
"gaussian");
208 parent.setAttribute(
"pattern",
"squarehorn");
213 parent.setAttribute(
"pattern",
"parabolic");
218 parent.setAttribute(
"pattern",
"xml");
223 parent.setAttribute(
"pattern",
"file");
228 parent.setAttribute(
"pattern",
"isotropic");
231 if (
antenna.getEfficiencyFactor() != 1.0)
242 parent.setAttribute(
"interpolation",
"static");
245 parent.setAttribute(
"interpolation",
"linear");
248 parent.setAttribute(
"interpolation",
"cubic");
252 for (
const auto& [pos, t] : path.
getCoords())
267 const auto start =
rotPath.getStart();
268 const auto rate =
rotPath.getRate();
291 rot_elem.setAttribute(
"interpolation",
"static");
294 rot_elem.setAttribute(
"interpolation",
"linear");
297 rot_elem.setAttribute(
"interpolation",
"cubic");
303 for (
const auto&
wp :
rotPath.getCoords())
309 azimuth = std::fmod(azimuth + 360.0, 360.0);
322 tx_elem.setAttribute(
"name",
tx.getName());
323 tx_elem.setAttribute(
"waveform", (
tx.getSignal() !=
nullptr) ?
tx.getSignal()->getName() :
"");
324 tx_elem.setAttribute(
"antenna", (
tx.getAntenna() !=
nullptr) ?
tx.getAntenna()->getName() :
"");
325 tx_elem.setAttribute(
"timing",
tx.getTiming() ?
tx.getTiming()->getName() :
"");
346 if (!
rx.isDechirpEnabled())
357 ref_elem.setAttribute(
"transmitter_name",
362 ref_elem.setAttribute(
"waveform_name",
365 const auto&
if_chain =
rx.getFmcwIfChainRequest();
366 if (
if_chain.sample_rate_hz.has_value())
370 if (
if_chain.filter_bandwidth_hz.has_value())
374 if (
if_chain.filter_transition_width_hz.has_value())
383 rx_elem.setAttribute(
"name",
rx.getName());
384 rx_elem.setAttribute(
"antenna", (
rx.getAntenna() !=
nullptr) ?
rx.getAntenna()->getName() :
"");
385 rx_elem.setAttribute(
"timing",
rx.getTiming() ?
rx.getTiming()->getName() :
"");
405 if (
rx.getNoiseTemperature() > 0)
417 mono_elem.setAttribute(
"antenna", (
tx.getAntenna() !=
nullptr) ?
tx.getAntenna()->getName() :
"");
418 mono_elem.setAttribute(
"waveform", (
tx.getSignal() !=
nullptr) ?
tx.getSignal()->getName() :
"");
419 mono_elem.setAttribute(
"timing",
tx.getTiming() ?
tx.getTiming()->getName() :
"");
439 if (
rx.getNoiseTemperature() > 0)
455 rcs_elem.setAttribute(
"type",
"isotropic");
460 rcs_elem.setAttribute(
"type",
"file");
465 if (
const auto*
model =
target.getFluctuationModel())
489 if (
tx->getAttached() !=
nullptr)
502 if (
rx->getPlatform() == &
platform && (
rx->getAttached() ==
nullptr))
Header file defining various types of antennas and their gain patterns.
Class representing a node in an XML document.
void setAttribute(const std::string_view name, const std::string_view value) const
Set an attribute on the XML element.
Abstract base class representing an antenna.
Represents a Gaussian-shaped antenna gain pattern.
Represents an antenna whose gain pattern is loaded from a HDF5 file.
Represents a parabolic reflector antenna.
Represents a sinc function-based antenna gain pattern.
Represents a square horn antenna.
Represents an antenna whose gain pattern is defined by an XML file.
The World class manages the simulator environment.
const std::vector< std::unique_ptr< radar::Target > > & getTargets() const noexcept
Retrieves the list of radar targets.
const std::vector< std::unique_ptr< radar::Transmitter > > & getTransmitters() const noexcept
Retrieves the list of radar transmitters.
const std::vector< std::unique_ptr< radar::Receiver > > & getReceivers() const noexcept
Retrieves the list of radar receivers.
Continuous-wave signal implementation.
Class representing a radar signal with associated properties.
const std::optional< std::string > & getFilename() const noexcept
Gets the filename associated with this signal.
const class FmcwTriangleSignal * getFmcwTriangleSignal() const noexcept
Gets the FMCW triangle implementation, if this signal owns one.
const std::string & getName() const noexcept
Gets the name of the radar signal.
RealType getCarrier() const noexcept
Gets the carrier frequency of the radar signal.
const Signal * getSignal() const noexcept
Gets the underlying signal object.
const class FmcwChirpSignal * getFmcwChirpSignal() const noexcept
Gets the FMCW chirp implementation, if this signal owns one.
RealType getPower() const noexcept
Gets the power of the radar signal.
Represents a path with coordinates and allows for various interpolation methods.
const std::vector< Coord > & getCoords() const noexcept
Gets the list of coordinates in the path.
@ INTERP_STATIC
Hold the first coordinate for all query times.
@ INTERP_LINEAR
Linearly interpolate between neighboring coordinates.
@ INTERP_CUBIC
Cubically interpolate between neighboring coordinates.
InterpType getType() const noexcept
Retrieves the current interpolation type of the path.
Manages rotational paths with different interpolation techniques.
@ INTERP_STATIC
Hold the first rotation for all query times.
@ INTERP_LINEAR
Linearly interpolate between neighboring rotations.
@ INTERP_CONSTANT
Hold the most recent rotation sample.
@ INTERP_CUBIC
Cubically interpolate between neighboring rotations.
RealType x
The x component of the vector.
RealType z
The z component of the vector.
RealType y
The y component of the vector.
Chi-square distributed RCS model.
Manages radar signal reception and response processing.
@ Transmitter
Use a named transmitter.
@ Custom
Use a named top-level waveform with the receiver schedule.
@ FLAG_NODIRECT
Disable direct-path reception.
@ FLAG_NOPROPLOSS
Disable propagation-loss scaling.
Base class for radar targets.
Represents a radar transmitter system.
Manages timing properties such as frequency, offsets, and synchronization.
double RealType
Type for real numbers.
constexpr RealType EPSILON
Machine epsilon for real numbers.
Coordinate and rotation structure operations.
std::string_view fmcwChirpDirectionToken(const FmcwChirpDirection direction) noexcept
Converts a chirp direction to the schema token.
@ UTM
Universal Transverse Mercator.
@ ENU
East-North-Up local tangent plane (default)
@ ECEF
Earth-Centered, Earth-Fixed.
RotationAngleUnit rotationAngleUnit() noexcept
Gets the external rotation angle unit.
@ Degrees
Compass azimuth and elevation expressed in degrees.
constexpr std::string_view rotationAngleUnitToken(const RotationAngleUnit unit) noexcept
Converts a rotation angle unit to its XML token.
std::string_view dechirpReferenceSourceToken(const Receiver::DechirpReferenceSource source) noexcept
Converts a dechirp reference source to its scenario token.
@ PULSED_MODE
The component operates in a pulsed mode.
@ FMCW_MODE
The component operates in an FMCW streaming mode.
std::string_view dechirpModeToken(const Receiver::DechirpMode mode) noexcept
Converts a dechirp mode to its scenario token.
RealType internal_elevation_to_external(const RealType elevation, const params::RotationAngleUnit unit) noexcept
Converts an internal elevation angle to the external unit.
RealType internal_azimuth_rate_to_external(const RealType azimuth_rate, const params::RotationAngleUnit unit) noexcept
Converts an internal azimuth rate to the external compass convention.
RealType internal_elevation_rate_to_external(const RealType elevation_rate, const params::RotationAngleUnit unit) noexcept
Converts an internal elevation rate to the external unit.
RealType internal_azimuth_to_external(const RealType azimuth, const params::RotationAngleUnit unit) noexcept
Converts an internal azimuth angle to the external compass convention.
void serializeMotionPath(const math::Path &path, const XmlElement &parent)
Serializes a motion path into a parent XML element.
void addChildWithNumber(const XmlElement &parent, const std::string &name, T value)
Adds a child element with the specified numeric content.
void addChildWithText(const XmlElement &parent, const std::string &name, const std::string &text)
Adds a child element with the specified text content.
static void serializeReceiverFmcwMode(const radar::Receiver &rx, const XmlElement &mode_elem)
void serializeReceiver(const radar::Receiver &rx, const XmlElement &parent)
Serializes a receiver into a parent XML element.
void serializeAntenna(const antenna::Antenna &antenna, const XmlElement &parent)
Serializes an antenna into a parent XML element.
void serializeMonostatic(const radar::Transmitter &tx, const radar::Receiver &rx, const XmlElement &parent)
Serializes a monostatic radar setup containing both a transmitter and receiver.
void serializeRotation(const math::RotationPath &rotPath, const XmlElement &parent)
Serializes a rotation path into a parent XML element.
void serializeSchedule(const std::vector< radar::SchedulePeriod > &schedule, const XmlElement &parent)
Serializes a schedule (active periods) into a parent XML element.
void serializePlatform(const radar::Platform &platform, const core::World &world, const XmlElement &parent)
Serializes a platform and its attached components into a parent XML element.
void serializeTransmitter(const radar::Transmitter &tx, const XmlElement &parent)
Serializes a transmitter into a parent XML element.
void serializeTarget(const radar::Target &target, const XmlElement &parent)
Serializes a target into a parent XML element.
void serializeTiming(const timing::PrototypeTiming &timing, const XmlElement &parent)
Serializes a timing object into a parent XML element.
void serializeWaveform(const fers_signal::RadarSignal &waveform, const XmlElement &parent)
Serializes a waveform into a parent XML element.
void setAttributeFromBool(const XmlElement &element, const std::string &name, const bool value)
Sets a boolean attribute on an XML element.
void serializeParameters(const XmlElement &parent, const params::Parameters &p)
Serializes a Parameters object into a parent XML element.
Provides the definition and functionality of the Path class for handling coordinate-based paths with ...
Header file for the PrototypeTiming class.
Classes for handling radar waveforms and signals.
Radar Receiver class for managing signal reception and response handling.
Defines the RotationPath class for handling rotational paths with different interpolation types.
Struct to hold simulation parameters.
static constexpr RealType DEFAULT_C
Speed of light (m/s)
Defines classes for radar targets and their Radar Cross-Section (RCS) models.
Timing source for simulation objects.
Header file for the Transmitter class in the radar namespace.
Header file for the World class in the simulator.
Core utility layer for serializing FERS XML scenario files.