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

Cast drawLine input arguments to int #264

Merged
merged 4 commits into from
Aug 12, 2022

Conversation

samiamlabs
Copy link
Contributor

I was getting the following error and resulting crash when using rqt_graph on humble with python 3.10.

Traceback (most recent call last):
  File "/home/ros/install/qt_dotgraph/local/lib/python3.10/dist-packages/qt_dotgraph/dot_shapes.py", line 16, in paint
    rectangle = QRect(self._bounding_box.topLeft().x(),
TypeError: arguments did not match any overloaded call:
  QRect(): too many arguments
  QRect(int, int, int, int): argument 1 has unexpected type 'float'
  QRect(QPoint, QPoint): argument 1 has unexpected type 'float'
  QRect(QPoint, QSize): argument 1 has unexpected type 'float'
  QRect(QRect): argument 1 has unexpected type 'float'
Aborted (core dumped)

Explicitly casting the inputs to int seems to resolve this issue.

Copy link
Contributor

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

Fix LGTM.
I have a minor comment about style.
Thanks for the contribution!!

qt_dotgraph/src/qt_dotgraph/dot_shapes.py Outdated Show resolved Hide resolved
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

I made the requested fixes on this PR, and this fixes the issue for me. I'm going to go ahead and run CI on this, and also port it over to the 'rolling' branch.

@clalancette
Copy link
Contributor

clalancette commented Aug 12, 2022

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@clalancette
Copy link
Contributor

The warning has nothing to do with this PR (though I'm not honestly sure why we see it in CI and not on the nightlies). Regardless, I'm going to go ahead and merge this one in.

@clalancette clalancette merged commit e0e1505 into ros-visualization:humble Aug 12, 2022
@clalancette
Copy link
Contributor

@Mergifyio backport rolling

@mergify
Copy link
Contributor

mergify bot commented Aug 12, 2022

backport rolling

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Aug 12, 2022
* Cast drawLine input arguments to int

Co-authored-by: Chris Lalancette <clalancette@openrobotics.org>
(cherry picked from commit e0e1505)
clalancette pushed a commit that referenced this pull request Aug 12, 2022
* Cast drawLine input arguments to int

Co-authored-by: Chris Lalancette <clalancette@openrobotics.org>
(cherry picked from commit e0e1505)

Co-authored-by: Samuel Lindgren <samuel@dynorobotics.se>
@samiamlabs samiamlabs deleted the humble-draw-line-fix branch August 12, 2022 19:53
@samiamlabs samiamlabs restored the humble-draw-line-fix branch August 12, 2022 19:53
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