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

uXRCE-DDS Client: Expose custom participant and localhost-only flags #22107

Merged
merged 4 commits into from
Oct 5, 2023

Conversation

DanMesh
Copy link
Contributor

@DanMesh DanMesh commented Sep 20, 2023

Solved Problem

The uxrce_dds_client can be started with flags to enable using a custom participant (-c) or localhost-only on the agent side (-l), but these were only available when starting the client by hand in the console.

Solution

Remove the CLI flags and instead a parameter for selecting the participant configuration, UXRCE_DDS_PTCFG.

This allows for selecting either the custom participant or localhost-only configuration, or neither (the default).

To Do

Additionally

  • Improve other parameter descriptions for the uxrce_dds_client.
  • Improve formatting of uxrce_dds_client status. For example:
INFO  [uxrce_dds_client] Running, connected
INFO  [uxrce_dds_client] Using transport:    udp
INFO  [uxrce_dds_client] Agent IP:           192.168.0.5
INFO  [uxrce_dds_client] Agent port:         8888
INFO  [uxrce_dds_client] Custom participant: no
INFO  [uxrce_dds_client] Localhost only:     yes
INFO  [uxrce_dds_client] Payload tx:         47811 B/s
INFO  [uxrce_dds_client] Payload rx:         0 B/s

Changelog Entry

For release notes:

uXRCE-DDS Client: expose custom participant and localhost-only flags as parameters
New parameters: UXRCE_DDS_PTCFG

Test coverage

  • Tested on n FMU v5x. Enabled the parameter in various combinations to verify the behaviour.

@DanMesh DanMesh requested a review from bkueng September 20, 2023 16:08
@DanMesh DanMesh self-assigned this Sep 20, 2023
dagar
dagar previously approved these changes Sep 20, 2023
Copy link
Member

@dagar dagar left a comment

Choose a reason for hiding this comment

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

Having these as both command line arguments and parameters seems like more trouble than it's worth, but otherwise looks good.

Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

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

At this point you could remove the CLI flags and make the param tri-state.

Can you also set it as default for v5x and v6x skynode?
In this file: https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5x/init/rc.board_defaults
Skynode detection: https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5x/init/rc.board_sensors#L52

@beniaminopozzan
Copy link
Member

On the other hand, as the CLI is already there, what about using the same approach of the mavlink module?

- command: |
if [ $SERIAL_DEV != ethernet ]; then
set MAV_ARGS "-d ${SERIAL_DEV} -b p:${BAUD_PARAM} -m p:MAV_${i}_MODE -r p:MAV_${i}_RATE"
else
set MAV_ARGS "-u p:MAV_${i}_UDP_PRT -o p:MAV_${i}_REMOTE_PRT -m p:MAV_${i}_MODE -r p:MAV_${i}_RATE"
if param compare MAV_${i}_BROADCAST 1
then
set MAV_ARGS "${MAV_ARGS} -p"
fi
if param compare MAV_${i}_BROADCAST 2
then
set MAV_ARGS "${MAV_ARGS} -c"
fi
fi
if param compare MAV_${i}_FORWARD 1
then
set MAV_ARGS "${MAV_ARGS} -f"
fi
if param compare MAV_${i}_RADIO_CTL 1
then
set MAV_ARGS "${MAV_ARGS} -s"
fi
if param compare MAV_${i}_FLOW_CTRL 0
then
set MAV_ARGS "${MAV_ARGS} -Z"
fi
if param compare MAV_${i}_FLOW_CTRL 1
then
set MAV_ARGS "${MAV_ARGS} -z"
fi
mavlink start ${MAV_ARGS} -x

I mean, tri state param, and the CLI flags are set in the command part of UXRCE_DDS_CFG

@bkueng , do you want v5x and v6x skynode to use -l or -c?

@DanMesh
Copy link
Contributor Author

DanMesh commented Sep 21, 2023

@beniaminopozzan Keeping the CLI and using it in the command section as you suggest is a nice idea. That way one can still stop and start the client from the console for testing, which is faster than always changing parameters and restarting.

For the defaults, I think we'd keep it that neither -l nor -c is used, as it is now.

* Align status values.
* Add indicators for the custom participant and localhost-only flags.
@DanMesh
Copy link
Contributor Author

DanMesh commented Sep 27, 2023

On further thought, having both the CLI flags and a parameter for these configurations seems somewhat unnecessary.
It means there could be two "sources of truth" for what the user intends to use, and could make the setup unpredictable for someone not familiar with the way we choose between the CLI and params.

So: I have now removed the CLI flags and only have the single tri-state "participant configuration" parameter, UXRCE_DDS_PTCFG.

Replaces the localhost-only and custom participant CLI flags
@DanMesh DanMesh force-pushed the expose-uxrce-dds-client-flags branch from 3e08d95 to 1a937bf Compare September 27, 2023 11:48
@DanMesh DanMesh requested review from bkueng and dagar October 2, 2023 15:32
@bkueng
Copy link
Member

bkueng commented Oct 3, 2023

Looks good, can you still add the skynode defaults?

@bkueng bkueng merged commit e00b35e into main Oct 5, 2023
87 checks passed
@bkueng bkueng deleted the expose-uxrce-dds-client-flags branch October 5, 2023 06:03
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

4 participants