ros2 / ros2/rosidl_python

Integers should be accepted as floats

Open
#172 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
EmberScript
Stars
26
Forks
68
Avg merge
2d 13h
Merged PRs (30d)
1

Description

Bug report

Required Info:

  • Operating System: Ubuntu 22.04
  • Installation type: binary
  • Version or commit hash: 0.15.0
  • DDS implementation: cyclonedds
  • Client library (if applicable): rclpy
Steps to reproduce issue
  1. Define a message with a float field
  2. Try to assign an integer to the field.
Expected behavior

The integer should be automatically casted to a float.

Actual behavior

You manually have to cast the integer to float, otherwise you get the error message AssertionError: The 'x' field must be of type 'float.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the assignment through the rclpy client library with a message containing a float field. Inspect the generated Python message field validation and identify where integer values are rejected. Done means integer assignment is accepted as a float without the reported AssertionError, with regression coverage for the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.