Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Setting Parameter of Type Double to Integer w/Trailing 0 Throws Type Error #6559

Closed
memtech3 opened this issue Jul 31, 2023 · 1 comment · Fixed by #6613
Closed

Setting Parameter of Type Double to Integer w/Trailing 0 Throws Type Error #6559

memtech3 opened this issue Jul 31, 2023 · 1 comment · Fixed by #6613
Labels
bug The user is unable to complete a supported task, or the software does not behave as intended

Comments

@memtech3
Copy link

When attempting to set a parameter with type double to values like 1.0 or 2.0 from the parameters panel, foxglove removes the trailing zero causing an error Failed to set one or more parameters for node '{NODE_NAME}': Wrong parameter type, parameter {PARAMETER_NAME} is of type {double}, setting it to {integer} is not allowed.

  • Version: 1.63
  • Platform: Web (Chrome), Windows (Electron)
  • Data source (e.g. bag file, mcap file, rosbridge, ROS 1/2 native): foxglove_bridge

Steps To Reproduce
Try setting a double typed parameter to 0.0, 1.0, or 2.0 in foxglove studio

Expected Behavior
When attempting to pass a value with a trailing 0 into a double typed parameter the value should retain its trailing 0. When attempting to pass an integer into a double typed parameter foxglove should add a trailing 0.

@memtech3 memtech3 added the bug The user is unable to complete a supported task, or the software does not behave as intended label Jul 31, 2023
@foxhubber
Copy link

foxhubber bot commented Jul 31, 2023

Internal tracking ticket: FG-4486

@memtech3 memtech3 changed the title Setting Parameter of Type Double to 1.0 Throws Type Error Setting Parameter of Type Double to Integer w/Trailing 0 Throws Type Error Jul 31, 2023
achim-k added a commit that referenced this issue Aug 16, 2023
**User-Facing Changes**
Not worth being mentioned in release notes

**Description**
When setting a float parameter to e.g. `1.0`, Javascript automatically
makes it to `1` and the server would deduce this as a integer parameter.
Remembering the parameter type that is communicated by the server, and
sending it along with a `setParameter` request fixes this.

See also foxglove/ws-protocol#519 and
foxglove/ros-foxglove-bridge#256

Fixes #6559
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug The user is unable to complete a supported task, or the software does not behave as intended
Development

Successfully merging a pull request may close this issue.

1 participant