Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ユーザーが外部磁気センサ I2Cアドレスを変更できるよう修正 #62

Merged
merged 4 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/initialize_files/components/rm3100_external.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ normal_random_standard_deviation_c_nT(2) = 15.0
range_to_constant_nT = 1.0e6 // smaller than Range_to_zero
range_to_zero_nT = 1.5e6

[I2C_PORT_2]
i2c_address = 0x23

[POWER_PORT]
minimum_voltage_V = 3.3 // V
assumed_power_consumption_W = 0.03 //W
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ normal_random_standard_deviation_c_nT(2) = 15.0
range_to_constant_nT = 1.0e6 // smaller than Range_to_zero
range_to_zero_nT = 1.5e6

[I2C_PORT_2]
i2c_address = 0x23

[POWER_PORT]
minimum_voltage_V = 3.3 // V
assumed_power_consumption_W = 0.03 //W
4 changes: 3 additions & 1 deletion src/simulation/spacecraft/aocs_module_components.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ AocsModuleComponents::AocsModuleComponents(const Dynamics *dynamics, Structure *
0, rm3100_aobc_hils_port_id, 0x20, aobc_, hils_port_manager_);
const std::string rm3100_ext_ini_path = iniAccess.ReadString("COMPONENTS_FILE", "magsensor_h_ext_file");
const unsigned int rm3100_ext_hils_port_id = iniAccess.ReadInt("COM_PORT", "rm3100_ext_hils_port_id");
IniAccess rm3100_ext_ini_access = IniAccess(rm3100_ext_ini_path);
const uint8_t rm3100_ext_i2c_address = (uint8_t)rm3100_ext_ini_access.ReadInt("I2C_PORT_2", "i2c_address");
rm3100_ext_ = new RM3100(Magnetometer(InitMagnetometer(clock_generator, power_controller_->GetPowerPort((int)PowerPortIdx::RM), 2,
rm3100_ext_ini_path, compo_step_sec, &local_environment_->GetGeomagneticField())),
0, rm3100_ext_hils_port_id, 0x23, aobc_, hils_port_manager_);
0, rm3100_ext_hils_port_id, rm3100_ext_i2c_address, aobc_, hils_port_manager_);

const std::string nanoSSOC_D60_ini_path = iniAccess.ReadString("COMPONENTS_FILE", "ss_file");
const unsigned int nanoSSOC_D60_pz_hils_port_id = iniAccess.ReadInt("COM_PORT", "nanoSSOC_D60_pz_hils_port_id");
Expand Down