f1tenth-dev / simulator

ROS & Gazebo F1/10 Autonomous Racecar Simulator
Apache License 2.0
77 stars 32 forks source link

i got error about control_plugin.py #21

Closed sensationHJ closed 3 years ago

sensationHJ commented 3 years ago

Hi first, really thanks about this package!

and..

unfortunately.. now im facing this error about control_plugin so i cant move my car ..

when i run

roslaunch f1tenth-sim simulator.master run_gazebo:=true i faced this errors

auto-starting new master
process[master]: started with pid [15240]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to c2842200-95c8-11eb-a7c8-3c7c3fb972a7
process[rosout-1]: started with pid [15251]
started core service [/rosout]
process[global_map_server-2]: started with pid [15258]
process[map_world_link-3]: started with pid [15259]
process[gazebo-4]: started with pid [15260]
process[gazebo_gui-5]: started with pid [15273]
[ INFO] [1617597506.064031476]: Loading map from image "/home/inspacehj/autosim_ws/src/simulator/map/race_track.pgm"
process[car_1_pit_stop_reset-6]: started with pid [15280]
process[car_1_spawn_model-7]: started with pid [15281]
process[car_1/controller_manager-8]: started with pid [15282]
process[car_1/base_laser_link-9]: started with pid [15283]
process[car_1/control_plugin-10]: started with pid [15284]
  File "/home/inspacehj/autosim_ws/src/simulator/src/set_racecar_state.py", line 49
    except rospy.ServiceException , error_msg: # except rospy.ServiceException , error_msg
                                  ^
SyntaxError: invalid syntax
[car_1_pit_stop_reset-6] process has died [pid 15280, exit code 1, cmd /home/inspacehj/autosim_ws/src/simulator/src/set_racecar_state.py car_1 map:=/map __name:=car_1_pit_stop_reset __log:=/home/inspacehj/.ros/log/c2842200-95c8-11eb-a7c8-3c7c3fb972a7/car_1_pit_stop_reset-6.log].
log file: /home/inspacehj/.ros/log/c2842200-95c8-11eb-a7c8-3c7c3fb972a7/car_1_pit_stop_reset-6*.log
Traceback (most recent call last):
  File "/home/inspacehj/autosim_ws/src/simulator/src/control_plugin.py", line 6, in <module>
    import tf2_ros
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 38, in <module>
    from tf2_py import *
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_py/__init__.py", line 38, in <module>
    from ._tf2 import *
ImportError: dynamic module does not define module export function (PyInit__tf2)
[ INFO] [1617597506.320458765]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1617597506.321301065]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[INFO] [1617597506.339151, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
[car_1/control_plugin-10] process has died [pid 15284, exit code 1, cmd /home/inspacehj/autosim_ws/src/simulator/src/control_plugin.py car_1 map:=/map __name:=control_plugin __log:=/home/inspacehj/.ros/log/c2842200-95c8-11eb-a7c8-3c7c3fb972a7/car_1-control_plugin-10.log].
log file: /home/inspacehj/.ros/log/c2842200-95c8-11eb-a7c8-3c7c3fb972a7/car_1-control_plugin-10*.log
[ INFO] [1617597506.366547847]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1617597506.367369391]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, ### waiting...
[INFO] [1617597506.592281, 0.000000]: Loading model XML from ros parameter car_1/robot_description
[INFO] [1617597506.597409, 0.000000]: Waiting for service /gazebo/spawn_urdf_model
[ INFO] [1617597507.633213224]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1617597507.643974914, 170.542000000]: Physics dynamic reconfigure ready.
[INFO] [1617597507.801485, 170.695000]: Calling service /gazebo/spawn_urdf_model
[ INFO] [1617597507.802594837, 170.696000000]: Read a 1200 X 1200 map @ 0.050 m/cell
[ INFO] [1617597508.055608994, 170.732000000]: Laser Plugin: Using the 'robotNamespace' param: '/'
[ INFO] [1617597508.055643371, 170.732000000]: Starting Laser Plugin (ns = /)
[ INFO] [1617597508.056442310, 170.732000000]: Laser Plugin (ns = /)  <tf_prefix_>, set to ""
[INFO] [1617597508.060419, 170.732000]: Spawn status: SpawnModel: Successfully spawned entity
[ INFO] [1617597508.190069914, 170.732000000]: Camera Plugin: Using the 'robotNamespace' param: '/'
[ INFO] [1617597508.191714534, 170.732000000]: Camera Plugin (ns = /)  <tf_prefix_>, set to ""
[car_1_spawn_model-7] process has finished cleanly

i dont know why this happen but i just guess that the problem from anaconda3

i installed anaconda3 before for python3... and i think that make crash

so i correct

File "/home/inspacehj/autosim_ws/src/simulator/src/set_racecar_state.py", line 49

except rospy.ServiceException , error_msg: 

except rospy.ServiceException as error_msg:

so first error( syntax error ) was removed but.. this error

[ INFO] [1617597665.588015870]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[car_1/control_plugin-10] process has died [pid 16272, exit code 1, cmd /home/inspacehj/autosim_ws/src/simulator/src/control_plugin.py car_1 map:=/map __name:=control_plugin __log:=/home/inspacehj/.ros/log/216f06cc-95c9-11eb-a7c8-3c7c3fb972a7/car_1-control_plugin-10.log].
log file: /home/inspacehj/.ros/log/216f06cc-95c9-11eb-a7c8-3c7c3fb972a7/car_1-control_plugin-10*.log

is still going on..

how can i fix this..?

sensationHJ commented 3 years ago

oh.. after remove anaconda3, it works!

and correct like this

except rospy.ServiceException as error_msg:

was not good attemption haha im not good at python :)

that makes other error and after correct now all the things goes great!