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

Allow using system ids other than 1 #1581

Merged
merged 2 commits into from
Apr 7, 2023

Conversation

Williangalvani
Copy link
Member

@Williangalvani Williangalvani commented Apr 6, 2023

This goes on the assumption that the vehicle is only one system with multiple components.
it relies on mavlink2rest to detect the most recent message received and locks on to that ID

Relevant to #1466

Copy link
Collaborator

@ES-Alexander ES-Alexander left a comment

Choose a reason for hiding this comment

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

Mostly looks good to me, although I haven't tested it.

I've left a couple of comments / suggestions :-)

@@ -205,7 +205,7 @@ export default Vue.extend({
},
mounted() {
mavlink2rest.startListening('HEARTBEAT').setCallback((message) => {
if (message?.header.system_id !== 1 || message?.header.component_id !== 1) {
if (message?.message.mavtype.type === 'MAV_TYPE_GCS' || message?.header.component_id !== 1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not certain what this mounted function is for. Is it supposed to indicate that the vehicle is connected to a topside computer, or is it supposed to show that an autopilot is connected and running well, or something else?

Does the current non-zero component ID check mean that being connected to the onboard camera manager counts as being mounted?

Copy link
Member Author

Choose a reason for hiding this comment

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

this makes the Heartbeat icon beat. This change makes it beat with anything sending a heartbeat that is not a GCS.
We should filter for all valid types here, too.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahh, I think I misunderstood the logic - your description clarified what it's actually doing, thanks :-)

That said, I don't think the heartbeat icon should beat if only the camera manager is present, so it should only be beating if there's a valid autopilot connected. Presumably that's what you meant by filtering for valid types?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

done

This goes on the assumption that the vehicle is only one system with multiple components.
it relies on mavlink2rest to detect the most recent message received and locks on to that ID
@@ -205,7 +205,7 @@ export default Vue.extend({
},
mounted() {
mavlink2rest.startListening('HEARTBEAT').setCallback((message) => {
if (message?.header.system_id !== 1 || message?.header.component_id !== 1) {
if (message?.message.mavtype.type === 'MAV_TYPE_GCS' || message?.header.component_id !== 1) {
Copy link
Member

Choose a reason for hiding this comment

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

@patrickelectric
Copy link
Member

There are some points where the system id is not defined globally.
Other extensions will fail, services that are not based on python may have the same logic, but identify different system ids.
What should we do with mavlink2rest, that needs the system id when starting from the command line: https://github.com/bluerobotics/BlueOS-docker/blob/537aa6d9f840e5af7b3489d872ef03e691056d98/core/start-blueos-core#L39

Isn't safer and simpler to use the MAV_SYSTEM_ID and use bootstrap to define such variable before starting all dockers ? With that there is a defined and global value for it where the user can configure the system. We could also do that once the parameter SYSID_THISMAV is changed by the user in BlueOS.

@Williangalvani
Copy link
Member Author

Isn't safer and simpler to use the MAV_SYSTEM_ID and use bootstrap to define such variable before starting all dockers ? With that there is a defined and global value for it where the user can configure the system. We could also do that once the parameter SYSID_THISMAV is changed by the user in BlueOS.

Things get messy as the parameter can be changed in multiple places, such as QGC.
But I'm thinking of actually doing both:

  • Have a interface where the user can change the environment variable and SYSID_THISMAV at the same time. This will be a reboot required for blueos due to using environment variables
  • At the same time, keep the automatic detection, additionally pushing a notification in case it gets triggered, so the user can fix things. Note that this only gets triggered after something goes on with getting data from the configured MAV_SYSTEM_ID

@Williangalvani
Copy link
Member Author

Williangalvani commented Apr 7, 2023

I'd like to get this in as is (scope-wise), then as I get the dialog in #1582, I intend to introduce some other vehicle-related configuration in there, as the expected system id

@patrickelectric patrickelectric merged commit 083ef95 into bluerobotics:master Apr 7, 2023
5 checks passed
@Williangalvani Williangalvani deleted the sysid branch April 7, 2023 20:37
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.

None yet

3 participants