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

test_turtlebot.py: addition on lists throws TypeError #14

Open
abhishek47kashyap opened this issue Oct 9, 2023 · 1 comment
Open

test_turtlebot.py: addition on lists throws TypeError #14

abhishek47kashyap opened this issue Oct 9, 2023 · 1 comment

Comments

@abhishek47kashyap
Copy link

python -m examples.test_turtlebot crashes due to this TypeError:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/abhishek/pybullet-planning/examples/test_turtlebot.py", line 98, in <module>
    main()
  File "/home/abhishek/pybullet-planning/examples/test_turtlebot.py", line 84, in main
    center = (lower + upper)/2. # Computing the center of the AABB
TypeError: unsupported operand type(s) for /: 'list' and 'float'

robot_aabb = get_subtree_aabb(robot, base_link) # Computes the robot's axis-aligned bounding box (AABB)
lower, upper = robot_aabb # Decomposing the AABB into the lower and upper extrema
center = (lower + upper)/2. # Computing the center of the AABB

Since lower and upper are both type list, adding them results in concatenation instead of element-wise addition.

@yasminedaly
Copy link

Do this and it should work just fine

lower = np.array(lower)
upper = np.array(upper)
center = (lower + upper) / 2.0

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

No branches or pull requests

2 participants