Skip to content

Enable Conservative RTK mode for MicroStrain GQ7#105

Open
aidan-laracy-HBK wants to merge 7 commits intomainfrom
feature/ConservativeRTKModeService
Open

Enable Conservative RTK mode for MicroStrain GQ7#105
aidan-laracy-HBK wants to merge 7 commits intomainfrom
feature/ConservativeRTKModeService

Conversation

@aidan-laracy-HBK
Copy link
Copy Markdown
Collaborator

This addition adds a param: enable_conservative_rtk (default is False) that will enable the conservative ambiguity fix mode on the internal receivers on the GQ7. This may result in a longer time to first fix and mode float solutions and results in a nearly certain RTK fix.


bool mipFilterReset(EmptySrv::Request& req, EmptySrv::Response& res);

bool mipEnableConservativeRTKMode(EmptySrv::Request& req, EmptySrv::Response& res);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is being done through config, this should probably be removed

Comment thread src/config.cpp Outdated
rtcm_on_main_port_ = false;
}

//Enable conservative RTK solution
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments should all start with spaces, so

// Enable conservative RTK solution

Comment thread src/config.cpp Outdated
else
MICROSTRAIN_MIP_SDK_ERROR(node_, mip_cmd_result, "Failed to set receiver 1 to direct mode.");

sleep(1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a comment to explain why we are sleeping for one second, and maybe investigate usleep to see if sleeping for maybe 100 milliseconds would be enough

Comment thread src/config.cpp Outdated

sleep(1);
//Here, we need to send the raw configuration bytes to the receiver to enable CAR mode for the RTK algorithm.
//First, define the UBX configuration bytes in a buffer. These are the raw bytes requred to write the RTK-Conservative Ambiguity Resolution mode to the receiver's Flash (change to RAM).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing about comment styling and maybe break it up into multiple lines.

Comment thread src/config.cpp Outdated
uint8_t data[] = {0xB5, 0x62, 0x06, 0x8A, 0x09, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, 0x00, 0x14, 0x20, 0x05, 0xe4, 0x07 };
size_t size = 17;

bool result = mip_device_->send(data, size);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this can only pass or fail, hanging onto result here doesn't make much sense. Instead you should be able to change the following if statement to be something like

if (mip_device_->send(data, size)
  ...
else
  ...

Comment thread src/config.cpp Outdated
else
MICROSTRAIN_MIP_SDK_ERROR(node_, mip_cmd_result_1, "Failed to set receiver 2 to direct mode.");

sleep(1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, explain why you need to sleep and investiage sleeping for less time

Comment thread src/config.cpp Outdated
//Here, we need to send the raw configuration bytes to the receiver to enable CAR mode for the RTK algorithm.
//First, define the UBX configuration bytes in a buffer. These are the raw bytes requred to write the RTK-Conservative Ambiguity Resolution mode to the receiver's Flash (change to RAM).

bool result_1 = mip_device_->send(data, size);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline in if statement like mentioned previously

Comment thread src/config.cpp Outdated
else
MICROSTRAIN_DEBUG(node_, "Failed to write bytes to receiver");
sleep(1);
const mip::CmdResult mip_cmd_result_2 = mip::commands_system::writeCommMode(*mip_device_, 0x01); //put the device back into normal mode
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reuse existing mip_cmd_result variable

Comment thread src/services.cpp
raw_file_config_aux_write_service_ = createService<RawFileConfigWriteSrv>(node_, RAW_FILE_CONFIG_AUX_WRITE_SERVICE, &Services::rawFileConfigAuxWrite, this);
}


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be removed

Comment thread src/services.cpp Outdated
}

} // namespace microstrain
} // namespace microstrain;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the semicolon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants