Skip to content

Conversation

@Williangalvani
Copy link
Member

image

Comment on lines 106 to 134
lights1_new_param(new_param_name: string | undefined) {
if (new_param_name) {
// reset any other parameter using lights1 to undefined
for (const old_param of this.servo_params) {
if (old_param.name === new_param_name) {
continue
}
if (old_param.value === Lights.Lights1) {
// set the old parameter to DISABLED
mavlink2rest.setParam(old_param.name, Lights.DISABLED, autopilot_data.system_id)
}
}
mavlink2rest.setParam(new_param_name, Lights.Lights1, autopilot_data.system_id)
}
},
lights2_new_param(new_param_name: string | undefined) {
if (new_param_name) {
// reset any other parameter using lights2 to undefined
for (const old_param of this.servo_params) {
if (old_param.name === new_param_name) {
continue
}
if (old_param.value === Lights.Lights2) {
// set the old parameter to DISABLED
mavlink2rest.setParam(old_param.name, Lights.DISABLED, autopilot_data.system_id)
}
}
mavlink2rest.setParam(new_param_name, Lights.Lights2, autopilot_data.system_id)
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we encapsulate this in a single function for both lights ?

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

<v-card>
<v-card-title> Joystick steps </v-card-title>
<v-card-text>
How many button presses it takes to go from 0% to 100% brightness.
Copy link
Member

Choose a reason for hiding this comment

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

I believe that asking the user a percentage per step over the number of buttons press is more friendly. Maybe rephrasing it helps.

Copy link
Member Author

Choose a reason for hiding this comment

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

improved the wording and added a live-updated percentage

@Williangalvani
Copy link
Member Author

updated

return {
lights1_new_param: undefined as (string | undefined), // item-value must be a primitive
lights2_new_param: undefined as (string | undefined),
steps_new_value: 0,
Copy link
Member

Choose a reason for hiding this comment

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

could we use a default value, like 10 ?
Other than that is just weird to start with 0 steps.

Copy link
Member Author

Choose a reason for hiding this comment

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

that should never happen, as we set it to the parameter value both when mounting (if the param is available) or when we detect a parameter change in the watcher. but I did update it anyway.

Copy link
Member

Choose a reason for hiding this comment

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

When you configure it for the first time, if the lights are not configured, it starts with 0.

@ES-Alexander
Copy link
Collaborator

Can we add a slider for the steps?
And min/max PWM limits?

Could also be nice to have a little graph showing the steps visually (with display options for both linear and Lumen-exponential brightness outputs).

It might make sense to have the channel controls in the top row, and then the steps slider + graph in a second row (instead of the current approach with everything in a single row).

Thinking something like this:
image

@patrickelectric
Copy link
Member

There is also another thing, the page end up showing for rover as well, should we remove it ?

@Williangalvani
Copy link
Member Author

Can we add a slider for the steps? And min/max PWM limits?

Could also be nice to have a little graph showing the steps visually (with display options for both linear and Lumen-exponential brightness outputs).

It might make sense to have the channel controls in the top row, and then the steps slider + graph in a second row (instead of the current approach with everything in a single row).

Thinking something like this: image

Fancy!
Idk.
I'm 50% "we can do this later as there's more calibration/setup stuff to be done" and 50% "let's do it now or it won't get done".
@patrickelectric thoughts?

Copy link
Member

@patrickelectric patrickelectric left a comment

Choose a reason for hiding this comment

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

We can move further required changes to issues.

@patrickelectric patrickelectric merged commit 620c314 into bluerobotics:master Feb 6, 2024
@Williangalvani Williangalvani deleted the lights branch February 6, 2024 21:05
@ES-Alexander ES-Alexander added the docs-needed Change needs to be documented label Feb 6, 2024
@ES-Alexander ES-Alexander added docs-minimal Documentation exists but should be improved and removed docs-needed Change needs to be documented labels Oct 6, 2024
@ES-Alexander ES-Alexander added the docs-in-progress Included in an open docs PR label Apr 15, 2025
@ES-Alexander ES-Alexander added docs-complete Change documentation has been completed and removed docs-minimal Documentation exists but should be improved docs-in-progress Included in an open docs PR labels Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-complete Change documentation has been completed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants