Skip to content

Commit

Permalink
fix name of functions and variables
Browse files Browse the repository at this point in the history
  • Loading branch information
TomokiMochizuki committed Jan 4, 2024
1 parent 3a6b199 commit 1812694
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions s2e-ff/data/initialize_files/components/laser_emitter.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ emitting_direction_c(2) = 1.0
emission_angle_rad = 0.1
emission_power_W = 2.16

beam_waist_m = 0.785e-3
rayleigh_range_m = 1.93
rayleigh_range_offset_m = 4.65
radius_beam_waist_m = 0.912e-3
rayleigh_length_m = 3.62
rayleigh_length_offset_m = 4.67

[LASER_EMITTER_1]
quaternion_b2c(0) = 0.0
Expand All @@ -39,6 +39,6 @@ emitting_direction_c(2) = 1.0
emission_angle_rad = 0.1
emission_power_W = 2.16

beam_waist_m = 0.785e-3
rayleigh_range_m = 1.93
rayleigh_range_offset_m = 4.65
radius_beam_waist_m = 0.912e-3
rayleigh_length_m = 3.62
rayleigh_length_offset_m = 4.67
26 changes: 13 additions & 13 deletions s2e-ff/src/components/aocs/laser_emitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

/**
* @class LaserEmitter
* @brief Corner Cube Reflector
* @brief Laser Emitter
*/
class LaserEmitter {
public:
Expand Down Expand Up @@ -63,12 +63,12 @@ class LaserEmitter {

inline double GetEmissionAngle_rad() const { return emission_angle_rad_; }
inline double GetEmissionPower_W() const { return emission_power_W_; }
inline double GetBeamWaist_m() const { return beam_waist_m_; }
inline double GetRayleighRange_m() const { return rayleigh_range_m_; }
inline double GetRayleighRangeOffset_m() const { return rayleigh_range_offset_m_; }
inline double GetRadiusBeamWaist_m() const { return radius_beam_waist_m_; }
inline double GetRayleighLength_m() const { return rayleigh_length_m_; }
inline double GetRayleighLengthOffset_m() const { return rayleigh_length_offset_m_; }

inline double GetBeamRadius_m(const double emission_distance_m) const {
double beam_radius_m = beam_waist_m_ * pow(1 + pow((emission_distance_m - rayleigh_range_offset_m_) / rayleigh_range_m_, 2.0), 0.5);
inline double GetBeamWidthRadius_m(const double emission_distance_m) const {
double beam_radius_m = radius_beam_waist_m_ * pow(1 + pow((emission_distance_m - rayleigh_length_offset_m_) / rayleigh_length_m_, 2.0), 0.5);
return beam_radius_m;
}

Expand All @@ -77,10 +77,10 @@ class LaserEmitter {
double emission_angle_rad_ = 0.0; //!< Laser emitting angle from the emitting direction [rad]
libra::TranslationFirstDualQuaternion dual_quaternion_c2b_; //!< Dual quaternion from body to component frame

double emission_power_W_ = 0.0; //!< Laser emission power [W]
double beam_waist_m_ = 0.0; //!< Beam waist of the laser [m]
double rayleigh_range_m_ = 0.0; //!< Rayleigh range of the laser [m]
double rayleigh_range_offset_m_ = 4.65; //!< Rayleigh range position offset of the laser [m]
double emission_power_W_ = 0.0; //!< Laser emission power [W]
double radius_beam_waist_m_ = 0.0; //!< Beam waist of the laser [m]
double rayleigh_length_m_ = 0.0; //!< Rayleigh length (range) of the laser [m]
double rayleigh_length_offset_m_ = 4.65; //!< Rayleigh length (range) position offset of the laser [m]

// Reference
const Dynamics* dynamics_;
Expand All @@ -101,9 +101,9 @@ class LaserEmitter {
emission_angle_rad_ = ini_file.ReadDouble(section_name.c_str(), "emission_angle_rad");
emission_power_W_ = ini_file.ReadDouble(section_name.c_str(), "emission_power_W");

beam_waist_m_ = ini_file.ReadDouble(section_name.c_str(), "beam_waist_m");
rayleigh_range_m_ = ini_file.ReadDouble(section_name.c_str(), "rayleigh_range_m");
rayleigh_range_offset_m_ = ini_file.ReadDouble(section_name.c_str(), "rayleigh_range_offset_m");
radius_beam_waist_m_ = ini_file.ReadDouble(section_name.c_str(), "radius_beam_waist_m");
rayleigh_length_m_ = ini_file.ReadDouble(section_name.c_str(), "rayleigh_length_m");
rayleigh_length_offset_m_ = ini_file.ReadDouble(section_name.c_str(), "rayleigh_length_offset_m");
}
};

Expand Down
2 changes: 1 addition & 1 deletion s2e-ff/src/components/aocs/quadrant_photodiode_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void QuadrantPhotodiodeSensor::MainRoutine(int count) {
actual_vertical_displacement_m_ = qpd_vertical_displacement_m;
}

qpd_received_laser_beam_radius_m = inter_spacecraft_communication_.GetLaserEmitter(laser_id).GetBeamRadius_m(qpd_laser_distance_m);
qpd_received_laser_beam_radius_m = inter_spacecraft_communication_.GetLaserEmitter(laser_id).GetBeamWidthRadius_m(qpd_laser_distance_m);
qpd_received_laser_power_W = inter_spacecraft_communication_.GetLaserEmitter(laser_id).GetEmissionPower_W();

CalcSensorOutput(qpd_received_laser_power_W, qpd_received_laser_beam_radius_m, qpd_horizontal_displacement_m, qpd_vertical_displacement_m);
Expand Down
2 changes: 1 addition & 1 deletion s2e-ff/src/simulation/spacecraft/ff_components_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ FfComponents2::FfComponents2(const Dynamics* dynamics, const Structure* structur
corner_cube_reflectors_.push_back(new CornerCubeReflector(file_name, dynamics_, id));
}
inter_spacecraft_communication.SetCornerCubeReflector(corner_cube_reflectors_);

file_name = sat_file.ReadString("COMPONENT_FILES", "laser_emitter_file");
config_->main_logger_->CopyFileToLogDirectory(file_name);
IniAccess laser_emitter_file(file_name);
Expand Down

0 comments on commit 1812694

Please sign in to comment.