robotpy / robotpy-wpilib

Moved to https://github.com/robotpy/mostrobotpy
https://robotpy.github.io
Other
169 stars 59 forks source link

HALError: Could not initialize HAL #28

Closed computer-whisperer closed 9 years ago

computer-whisperer commented 9 years ago

Whenever I try to use wpilib in a robot.py script, the following error occurs upon loading the library:

Traceback (most recent call last):
  File "/home/christian/PycharmProjects/modded-command/robot.py", line 16, in <module>
    wpilib.RobotBase.main(MyRobot)
  File "/home/christian/robotpy-2015/lib/python3.4/site-packages/wpilib/robotbase.py", line 129, in main
    RobotBase.initializeHardwareConfiguration()
  File "/home/christian/robotpy-2015/lib/python3.4/site-packages/wpilib/robotbase.py", line 119, in initializeHardwareConfiguration
    hal.HALInitialize()
  File "/home/christian/robotpy-2015/lib/python3.4/site-packages/hal/functions.py", line 108, in HALInitialize
    raise HALError("Could not initialize HAL")
hal.exceptions.HALError: Could not initialize HAL

This was run from a virtualenv, with wpilib, hal-base, and hal-sim installed via the workaround in #27.

A temporary fix suggested by virtuald is to have, in hal-sim/hal_impl/functions.py, set HALInitialize to return True And it seems solve the issue.

I would fork and pull request the fix, but my team's request for a github account has not been returned yet, so I wouldn't be able to keep the fork as a private repository.

virtuald commented 9 years ago

If you fork a private repository, it will remain private.

virtuald commented 9 years ago

Fixed in 0416538 .. though, it shows another error after that.

virtuald commented 9 years ago

BTW, it should run all the way through now. However, it doesn't do anything useful as there isn't a simulation engine hooked into it.

computer-whisperer commented 9 years ago

Right, all I was trying to was get it to spit out "Hello World" from robotInit

virtuald commented 9 years ago

That should work now.

computer-whisperer commented 9 years ago

And it does