justagist / panda_simulator

A Gazebo simulator for the Franka Emika Panda robot with ROS interface, supporting sim-to-real code transfer (Python). Exposes customisable controllers and state feedback from robot in simulation.
Apache License 2.0
188 stars 58 forks source link

Python f strings exceptions #31

Closed aPonza closed 3 years ago

aPonza commented 3 years ago

I followed the "Installation" guide (kinetic, resolved dependencies then used the build script) with no error. When trying to launch the simulator as per the "Usage" section, I face the following exceptions. I read the "Known Issues" and the already resolved issues with no mention of this problem. What do you think it could be? AFAIK f strings are from python 3 and not 2, but kinetic runs on python 2.

Traceback (most recent call last):
  File "/home/ap/catkin_ws/src/panda_simulator/panda_sim_custom_action_server/scripts/start_gripper_action_server.py", line 33, in <module>
    from panda_sim_custom_action_server import GripperActionServer
  File "/home/ap/catkin_ws/devel/lib/python2.7/dist-packages/panda_sim_custom_action_server/__init__.py", line 34, in <module>
    exec(__fh.read())
  File "<string>", line 18, in <module>
  File "/home/ap/catkin_ws/src/panda_simulator/panda_sim_custom_action_server/src/panda_sim_custom_action_server/joint_trajectory_action_server.py", line 60, in <module>
    import franka_interface
  File "/home/ap/catkin_ws/src/franka_ros_interface/franka_interface/src/franka_interface/__init__.py", line 18, in <module>
    from .arm import ArmInterface
  File "/home/ap/catkin_ws/src/franka_ros_interface/franka_interface/src/franka_interface/arm.py", line 37, in <module>
    import quaternion
  File "/home/ap/.local/lib/python2.7/site-packages/quaternion/__init__.py", line 29, in <module>
    from .quaternion_time_series import (
  File "/home/ap/.local/lib/python2.7/site-packages/quaternion/quaternion_time_series.py", line 48
    raise ValueError(f"Requested axis {axis} is outside the input array's shape {q.shape}")
                                                                                         ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "/home/ap/catkin_ws/src/panda_simulator/panda_sim_custom_action_server/scripts/start_joint_trajectory_server.py", line 40, in <module>
    from panda_sim_custom_action_server import (
  File "/home/ap/catkin_ws/devel/lib/python2.7/dist-packages/panda_sim_custom_action_server/__init__.py", line 34, in <module>
    exec(__fh.read())
  File "<string>", line 18, in <module>
  File "/home/ap/catkin_ws/src/panda_simulator/panda_sim_custom_action_server/src/panda_sim_custom_action_server/joint_trajectory_action_server.py", line 60, in <module>
    import franka_interface
  File "/home/ap/catkin_ws/src/franka_ros_interface/franka_interface/src/franka_interface/__init__.py", line 18, in <module>
    from .arm import ArmInterface
  File "/home/ap/catkin_ws/src/franka_ros_interface/franka_interface/src/franka_interface/arm.py", line 37, in <module>
    import quaternion
  File "/home/ap/.local/lib/python2.7/site-packages/quaternion/__init__.py", line 29, in <module>
    from .quaternion_time_series import (
  File "/home/ap/.local/lib/python2.7/site-packages/quaternion/quaternion_time_series.py", line 48
    raise ValueError(f"Requested axis {axis} is outside the input array's shape {q.shape}")
                                                                                         ^
SyntaxError: invalid syntax
justagist commented 3 years ago

Hi, This is not an fstring issue. It's a bug in the new version of the numpy-quaternion module. This is the same issue as #30. Please use an older version of numpy-quaternion.

aPonza commented 3 years ago

Cheers! Unfortunately it didn't pop-up in my search due to the other user not posting the code but a screenshot. Now it should pop-up for anyone else.

justagist commented 3 years ago

It probably didn't show up because you didn't realise it was a numpy-quaternion error. The title of this issue would be misleading for anyone who comes across this.