fdcl-gwu / uav_simulator

Python - Gazebo Simulation Environment for a UAV with Geometric Control
MIT License
107 stars 29 forks source link

[SyntaxError] python main.py #2

Closed bigbigpark closed 2 years ago

bigbigpark commented 2 years ago
Traceback (most recent call last):
  File "main.py", line 3, in <module>
    from rover import rover, reset_uav
  File "/home/park/catkin_ws/src/uav_simulator/scripts/rover.py", line 1, in <module>
    from matrix_utils import hat, vee, q_to_R
  File "/home/park/catkin_ws/src/uav_simulator/scripts/matrix_utils.py", line 140
    R = np.eye(3) + y * hat_r + 0.5 * y2**2 * hat_r @ hat_r
                                                    ^
SyntaxError: invalid syntax

How can I solve this syntax error? I found the error is about decorator in Python syntax but I'm not familiar to this environment

kanishkegb commented 2 years ago

Do you run python3 main.py or python main.py?

Also, which python version do you use?

bigbigpark commented 2 years ago

I run the code using Python 2.0

My desktop is operating on Ubuntu 18.04 (ROS Melodic).

Thanks

2022년 3월 7일 (월) 오후 9:33, Kanishke Gamagedara @.***>님이 작성:

Do you run python3 main.py or python main.py?

Also, which python version do you use?

— Reply to this email directly, view it on GitHub https://github.com/fdcl-gwu/uav_simulator/issues/2#issuecomment-1060639837, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARMO3H5QV3MHCRYZSO5DBCLU6XZP3ANCNFSM5QCIXRJQ . You are receiving this because you authored the thread.Message ID: @.***>

--

Park, Seong Chang

Master Course of Smart Automobile Eng.

Mobility & Robotic systems Lab(MRL)

Soonchunhyang University

Tel : +82-10-3088-4871

E-mail :* @. @.>*

kanishkegb commented 2 years ago

It seems like a Python version issue. According to this, matrix multiplication using "@" was introduced in Python 3.5. You either have to upgrade your Python version to >3.5 or replace multiplication operations that uses "@" with matmul or dot.

bigbigpark commented 2 years ago

Oh thanks :)
I got new information about that!
However, I use ROS framework :( so I have to Python version 2.0