Log in

View Full Version : Building RobotPy from git repo


tux
28-01-2011, 15:47
Hello. I worked with FIRST programming a few years ago, but Wind River is new to me. I'd really like to get the RobotPy system going, as I believe it will make development much quicker and easier.

I'm trying to build from the git repo (maybe you will say that I should just use the built distribution, and that's fair, but I'd like to get this working from the source.)

I found this in the README

"""
To build the interpreter: open the RobotPy directory as a Wind River project.
Build the project and download the code to your robot. Now you have the
Python interpreter on the robot.
"""

Here is what I did:

Start Wind River Workbench
Create a new folder (on Desktop) for workspace and select it
When Workbench loads, click the X on the only tab to close the welcome screen
Click File -> New Wind River Workbench Project...
Set Target Operating System to Wind River VxWorks 6.3 and click Next
Set Build Type to Downloadable Kernel Module
Click Create project in workspace with content at external location
Browse to the git repository and select ...gitrepo/RobotPy/RobotPy
Click Finish

In the Wind River Workbench, top left panel...
Right click on the project name and choose Build Project
Choose Generate Includes and click Next
Leave everything else at default settings
Click Next and Finish


(Please tell me if any of that is wrong. I did not find a simpler way to "open the RobotPy directory as a Wind River project.")


The build proceeds for a while, then stops with an error:

building pyFIRST_partialImage/Debug/Objects/pyFIRST/RobotPy/Python/Modules/posixmodule.o
"C:/Users/Developer/Desktop/FIRST_2011/python/gitrepo/RobotPy/RobotPy/Python/Modules/posixmodule.c", line 3977: error (dcc:1551): argument type does not match prototype
"C:/Users/Developer/Desktop/FIRST_2011/python/gitrepo/RobotPy/RobotPy/Python/Modules/posixmodule.c", line 4949: warning (dcc:1481): function close not declared
"C:/Users/Developer/Desktop/FIRST_2011/python/gitrepo/RobotPy/RobotPy/Python/Modules/posixmodule.c", line 4990: warning (dcc:1481): function dup not declared
"C:/Users/Developer/Desktop/FIRST_2011/python/gitrepo/RobotPy/RobotPy/Python/Modules/posixmodule.c", line 5011: warning (dcc:1481): function dup2 not declared
"C:/Users/Developer/Desktop/FIRST_2011/python/gitrepo/RobotPy/RobotPy/Python/Modules/posixmodule.c", line 5096: warning (dcc:1481): function read not declared
"C:/Users/Developer/Desktop/FIRST_2011/python/gitrepo/RobotPy/RobotPy/Python/Modules/posixmodule.c", line 5124: warning (dcc:1481): function write not declared
"C:/Users/Developer/Desktop/FIRST_2011/python/gitrepo/RobotPy/RobotPy/Python/Modules/posixmodule.c", line 5436: warning (dcc:1481): function putenv not declared
C:\WindRiver\vxworks-6.3\host\x86-win32\bin\make.exe: *** [pyFIRST_partialImage/Debug/Objects/pyFIRST/RobotPy/Python/Modules/posixmodule.o] Error 1
Build Failed in Project 'pyFIRST' (Process Exit Value was 2): 2011-01-28 15:31:48 (Elapsed Time: 00:37)

tux
28-01-2011, 16:42
Ah, I think I have it now.

I could not figure out why Project -> Open was greyed out.

But... what I needed to do was File -> Import

tux
28-01-2011, 17:28
Ok. I believe I have the first part working. I got the Wind River project loaded and built. Now I am trying to build the loadable modules.

When I go to the RobotPy directory and make, I get an error:

make[2]: Entering directory `c:/Users/Developer/Desktop/RobotPy/Modules/readline
'
make -C readline
make[3]: Entering directory `c:/Users/Developer/Desktop/RobotPy/Modules/readline
/readline'
C:/WindRiver/workbench-3.0/x86-win32/bin/sh.exe ./config.status --recheck
./config.status: ./config.status: No such file or directory
make[3]: *** [config.status] Error 1
make[3]: Leaving directory `c:/Users/Developer/Desktop/RobotPy/Modules/readline/
readline'
make[2]: *** [allsub] Error 2
make[2]: Leaving directory `c:/Users/Developer/Desktop/RobotPy/Modules/readline'

make[1]: *** [all] Error 2
make[1]: Leaving directory `c:/Users/Developer/Desktop/RobotPy/Modules'
make: *** [all] Error 2



I figure I don't really need readline, so I removed that line from the Makefile and tried again. I got another error:

make -C wpilib
make[2]: Entering directory `c:/Users/Developer/Desktop/RobotPy/Packages/wpilib'

building wpilib_wrap.o
wpilib_wrap.cxx: In function `void SWIG_Python_SetModule(swig_module_info*)':
wpilib_wrap.cxx:2515: warning: unused variable 'swig_empty_runtime_method_table'

wpilib_wrap.cxx: In function `PyObject* _wrap_new_SpeedController(PyObject*, PyO
bject*)':
wpilib_wrap.cxx:6643: error: cannot allocate an object of type `SwigDirector_Spe
edController'
wpilib_wrap.cxx:6643: error: because the following virtual functions are abstr
act:
C:/WindRiver/vxworks-6.3/target/h/WPILib/SpeedController.h:25: error: virtual v
oid SpeedController::Set(float, UINT8)
C:/WindRiver/vxworks-6.3/target/h/WPILib/SpeedController.h:35: error: virtual v
oid SpeedController::Disable()
wpilib_wrap.cxx: In function `PyObject* _wrap_new_RobotDrive__SWIG_0(PyObject*,
PyObject*)':
wpilib_wrap.cxx:21011: error: no matching function for call to `RobotDrive::Robo
tDrive(UINT32&, UINT32&, float&)'
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:94: note: candidates are:
RobotDrive::RobotDrive(const RobotDrive&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:46: note:
RobotDrive::RobotDrive(SpeedController&, SpeedController&, SpeedController&, Spe
edController&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:44: note:
RobotDrive::RobotDrive(SpeedController*, SpeedController*, SpeedController*, Spe
edController*)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:42: note:
RobotDrive::RobotDrive(SpeedController&, SpeedController&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:41: note:
RobotDrive::RobotDrive(SpeedController*, SpeedController*)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:40: note:
RobotDrive::RobotDrive(UINT32, UINT32, UINT32, UINT32)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:38: note:
RobotDrive::RobotDrive(UINT32, UINT32)
wpilib_wrap.cxx: In function `PyObject* _wrap_new_RobotDrive__SWIG_2(PyObject*,
PyObject*)':
wpilib_wrap.cxx:21108: error: no matching function for call to `RobotDrive::Robo
tDrive(UINT32&, UINT32&, UINT32&, UINT32&, float&)'
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:94: note: candidates are:
RobotDrive::RobotDrive(const RobotDrive&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:46: note:
RobotDrive::RobotDrive(SpeedController&, SpeedController&, SpeedController&, Spe
edController&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:44: note:
RobotDrive::RobotDrive(SpeedController*, SpeedController*, SpeedController*, Spe
edController*)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:42: note:
RobotDrive::RobotDrive(SpeedController&, SpeedController&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:41: note:
RobotDrive::RobotDrive(SpeedController*, SpeedController*)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:40: note:
RobotDrive::RobotDrive(UINT32, UINT32, UINT32, UINT32)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:38: note:
RobotDrive::RobotDrive(UINT32, UINT32)
wpilib_wrap.cxx: In function `PyObject* _wrap_new_RobotDrive__SWIG_4(PyObject*,
PyObject*)':
wpilib_wrap.cxx:21205: error: no matching function for call to `RobotDrive::Robo
tDrive(SpeedController*&, SpeedController*&, float&)'
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:94: note: candidates are:
RobotDrive::RobotDrive(const RobotDrive&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:46: note:
RobotDrive::RobotDrive(SpeedController&, SpeedController&, SpeedController&, Spe
edController&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:44: note:
RobotDrive::RobotDrive(SpeedController*, SpeedController*, SpeedController*, Spe
edController*)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:42: note:
RobotDrive::RobotDrive(SpeedController&, SpeedController&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:41: note:
RobotDrive::RobotDrive(SpeedController*, SpeedController*)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:40: note:
RobotDrive::RobotDrive(UINT32, UINT32, UINT32, UINT32)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:38: note:
RobotDrive::RobotDrive(UINT32, UINT32)
wpilib_wrap.cxx: In function `PyObject* _wrap_new_RobotDrive__SWIG_6(PyObject*,
PyObject*)':
wpilib_wrap.cxx:21302: error: no matching function for call to `RobotDrive::Robo
tDrive(SpeedController*&, SpeedController*&, SpeedController*&, SpeedController*
&, float&)'
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:94: note: candidates are:
RobotDrive::RobotDrive(const RobotDrive&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:46: note:
RobotDrive::RobotDrive(SpeedController&, SpeedController&, SpeedController&, Spe
edController&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:44: note:
RobotDrive::RobotDrive(SpeedController*, SpeedController*, SpeedController*, Spe
edController*)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:42: note:
RobotDrive::RobotDrive(SpeedController&, SpeedController&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:41: note:
RobotDrive::RobotDrive(SpeedController*, SpeedController*)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:40: note:
RobotDrive::RobotDrive(UINT32, UINT32, UINT32, UINT32)
C:/WindRiver/vxworks-6.3/target/h/WPILib/RobotDrive.h:38: note:
RobotDrive::RobotDrive(UINT32, UINT32)
wpilib_wrap.cxx: In function `PyObject* _wrap_RobotDrive_SetLeftRightMotorSpeeds
(PyObject*, PyObject*)':
wpilib_wrap.cxx:22693: error: 'class RobotDrive' has no member named 'SetLeftRig
htMotorSpeeds'
wpilib_wrap.cxx: In function `PyObject* PyInit__wpilib()':
wpilib_wrap.cxx:27418: error: `kPercentVoltage' is not a member of `CANJaguar'
make[2]: *** [wpilib_wrap.o] Error 1
make[2]: Leaving directory `c:/Users/Developer/Desktop/RobotPy/Packages/wpilib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `c:/Users/Developer/Desktop/RobotPy/Packages'
make: *** [all] Error 2



So. Any hints?

BotnEyedJoe
28-01-2011, 21:12
I have a feeling from looking at the error messages that you are not building version 2011.2 or newer? Check which git branch you are working on. Not sure, but it seems like the HEAD (a.k.a. master) is not the most recent code, the 2011 branch is. I built the most recent tip of the 2011 branch just this week, and I don't recognize a lot of the things going on in your error messages, and did not have the problems you describe.

One caveat, though, re: something not mentioned in the README instructions. AFAIK, The SIP outputs don't seem to be in the repository, so before you build the Packages, you need to use SIP to create the wrappers for the various libraries (e.g. WPILib). [RoboytPy switched from SWIG to SIP somewhere along the 2011 branch.] In each of the individual Packages, there is a .bat file showing how to run SIP for that Package. Then, perform the make where you are having the problems... Perhaps an analogous problem is what you are actually experiencing - that is, the SWIG wrappers are missing?

Hopefully, Peter Johnson will correct anything I've said wrong or misleading (my apologies in advance).

tux
28-01-2011, 22:02
You are right. I was on master. I did not realize I needed to switch to a different branch.

So, to get the right code I am doing:
git clone git://git.tortall.net/RobotPy.git

Then, from inside the cloned repo:
git checkout 2011


I will try that and see if I can build now. Thanks!

tux
28-01-2011, 23:21
Making progress...

I am up to where the SIP output is needed. I installed the latest sip on my linux desktop where I have the git repo checked out. Will that produce the same output as running it on windows would?

Running the bat file commands works for nivision and wpilib, but I get errors with vision and vision2009:

sip: Unable to find file "FrcError.sip"

I found the problem:

The file is named FRCError.sip and the difference in case is making it miss the file on linux. Renaming it allows me to move forward.

I will move the Packages directory back over to the machine with Wind River and see if I can build now.

tux
28-01-2011, 23:50
Ok. Got it all built. Sweet!

Now, a possibly silly question:

The "from source" instructions say to:
Delete the ``dist\RobotPy-Core\robot\ni-rt`` directory tree.

before uploading to the robot, but the 2011.2 pre-compiled zip file has the ni-rt directory intact and the README in there does not mention removing ni-rt before uploading.

The file in that directory is

ni-rt/system/FRC_UserProgram.out

Is that one supposed to be copied over to the robot or not?

BotnEyedJoe
29-01-2011, 00:17
[

The "from source" instructions say to:
Delete the ``dist\RobotPy-Core\robot\ni-rt`` directory tree.

before uploading to the robot, but the 2011.2 pre-compiled zip file has the ni-rt directory intact and the README in there does not mention removing ni-rt before uploading.

The file in that directory is

ni-rt/system/FRC_UserProgram.out

Is that one supposed to be copied over to the robot or not?

I think normally you would not delete the ni-rt tree from your distrib. But, in the context of the README, in a previous step of the instructions, you already installed the ni-rt/system/FRC_UserProgram.out onto the robot, and therefore it does not need to be installed again [when the dist contents are copied over].

BotnEyedJoe
03-02-2011, 20:27
Another distinction to make here is that the documented build process actually builds the FRC_UserProgram executable twice. The first time [inside the Wind River IDE] it builds the Debug version, and the second time [within the 'make' which is done from the shell] it builds a NonDebug version.

Following the README instructions will result in the Debug version being installed on the robot, where the version that is placed into the distribution by make-dist is the NonDebug.