Skip to content

Bug with push button #103

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

Open
maximericaud opened this issue Mar 17, 2023 · 2 comments
Open

Bug with push button #103

maximericaud opened this issue Mar 17, 2023 · 2 comments

Comments

@maximericaud
Copy link

Describe the bug

process[car/state_publisher-16]: started with pid [14068]
Traceback (most recent call last):
  File "/home/robot/catkin_ws/src/mushr/mushr_hardware/push_button_utils/src/push_button.py", line 3, in <module>
    import Jetson.GPIO as GPIO
  File "/usr/local/lib/python2.7/dist-packages/Jetson/GPIO/__init__.py", line 1, in <module>
    from .gpio import *
  File "/usr/local/lib/python2.7/dist-packages/Jetson/GPIO/gpio.py", line 23, in <module>
    from Jetson.GPIO import gpio_pin_data
  File "/usr/local/lib/python2.7/dist-packages/Jetson/GPIO/gpio_pin_data.py", line 560
    msg = f"Environment variable 'JETSON_MODEL_NAME={model_name}' is invalid."
                                                                             ^
SyntaxError: invalid syntax
[car/push_button-14] process has died [pid 14050, exit code 1, cmd /home/robot/catkin_ws/src/mushr/mushr_hardware/push_button_utils/src/push_button.py __name:=push_button __log:=/home/robot/.ros/log/ed4a237a-c4a3-11ed-b0ca-0e569ec1aa55/car-push_button-14.log].
log file: /home/robot/.ros/log/ed4a237a-c4a3-11ed-b0ca-0e569ec1aa55/car-push_button-14*.log

To Reproduce
Steps to reproduce the behavior:

  1. Open terminal
  2. roslaunch mushr_base teleop.launch
  3. See log attached

Environment

  • OS: Ubuntu 18.04 LTS
  • Platform: Jetson Nano
  • Library versions: ROS melodic, python 2.7.17

ed4a237a-c4a3-11ed-b0ca-0e569ec1aa55.zip

@sidtalia
Copy link

Hi Maxime,

Apologies for the late response. MuSHR has moved to ROS-noetic since 2022, could you try using noetic instead?

Best,
Sidharth Talia.

@DKrishna007
Copy link

I'm guessing the issue is that the Jetson.GPIO library you're using is written for Python 3, but you're running it in a Python 2 ROS environment.

you can downgrade jetson.GPIO or move to Noetic since melodic is stuck to python2 or a quick hack: Patch the Library Manually

Open in bash:
sudo nano /usr/local/lib/python2.7/dist-packages/Jetson/GPIO/gpio_pin_data.py

Change the f-string to a regular string format, Replace:
msg = f"Environment variable 'JETSON_MODEL_NAME={model_name}' is invalid."
With:
msg = "Environment variable 'JETSON_MODEL_NAME={}' is invalid.".format(model_name)

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

3 participants