|
5 | 5 |
|
6 | 6 | # Get PYREP root and find the needed files to compile the cffi lib.
|
7 | 7 |
|
8 |
| -if 'VREP_ROOT' not in os.environ: |
9 |
| - raise RuntimeError('VREP_ROOT not defined.') |
| 8 | +if 'COPPELIASIM_ROOT' not in os.environ: |
| 9 | + raise RuntimeError('COPPELIASIM_ROOT not defined.') |
10 | 10 |
|
11 |
| -if not os.path.exists(os.environ['VREP_ROOT']): |
12 |
| - raise RuntimeError('VREP_ROOT defined, but is not a valid path.') |
| 11 | +if not os.path.exists(os.environ['COPPELIASIM_ROOT']): |
| 12 | + raise RuntimeError('COPPELIASIM_ROOT defined, but is not a valid path.') |
13 | 13 |
|
14 | 14 | ffibuilder = FFI()
|
15 | 15 |
|
16 | 16 | ffibuilder.cdef("""
|
17 | 17 |
|
18 | 18 | // ==============
|
19 |
| -// v_repTypes.h |
| 19 | +// simTypes.h |
20 | 20 | // ==============
|
21 | 21 |
|
22 | 22 | // Various types used in the interface functions:
|
|
84 | 84 |
|
85 | 85 |
|
86 | 86 | // ==============
|
87 |
| -// v_rep.h |
| 87 | +// sim.h |
88 | 88 | // ==============
|
89 | 89 |
|
90 | 90 | simInt simRunSimulator(const simChar* applicationName,simInt options,simVoid(*initCallBack)(),simVoid(*loopCallBack)(),simVoid(*deinitCallBack)());
|
|
233 | 233 | simVoid* simSendModuleMessage(simInt message,simInt* auxiliaryData,simVoid* customData,simInt* replyData);
|
234 | 234 | simVoid* simBroadcastMessage(simInt* auxiliaryData,simVoid* customData,simInt* replyData);
|
235 | 235 | simChar* simGetModuleName(simInt index,simUChar* moduleVersion);
|
236 |
| -simChar* simGetScriptSimulationParameter(simInt scriptHandle,const simChar* parameterName,simInt* parameterLength); |
237 |
| -simInt simSetScriptSimulationParameter(simInt scriptHandle,const simChar* parameterName,const simChar* parameterValue,simInt parameterLength); |
238 | 236 | simInt simFloatingViewAdd(simFloat posX,simFloat posY,simFloat sizeX,simFloat sizeY,simInt options);
|
239 | 237 | simInt simFloatingViewRemove(simInt floatingViewHandle);
|
240 | 238 | simInt simAdjustView(simInt viewHandleOrIndex,simInt associatedViewableObjectHandle,simInt options,const simChar* viewLabel);
|
|
501 | 499 | simChar* simOpenTextEditor(const simChar* initText,const simChar* xml,simInt* various);
|
502 | 500 | simChar* simPackTable(simInt stackHandle,simInt* bufferSize);
|
503 | 501 | simInt simUnpackTable(simInt stackHandle,const simChar* buffer,simInt bufferSize);
|
504 |
| -simInt simSetVisionSensorFilter(simInt visionSensorHandle,simInt filterIndex,simInt options,const simInt* pSizes,const simUChar* bytes,const simInt* ints,const simFloat* floats,const simUChar* custom); |
505 |
| -simInt simGetVisionSensorFilter(simInt visionSensorHandle,simInt filterIndex,simInt* options,simInt* pSizes,simUChar** bytes,simInt** ints,simFloat** floats,simUChar** custom); |
506 | 502 | simInt simSetReferencedHandles(simInt objectHandle,simInt count,const simInt* referencedHandles,const simInt* reserved1,const simInt* reserved2);
|
507 | 503 | simInt simGetReferencedHandles(simInt objectHandle,simInt** referencedHandles,simInt** reserved1,simInt** reserved2);
|
508 | 504 | simInt simGetShapeViz(simInt shapeHandle,simInt index,struct SShapeVizInfo* info);
|
|
518 | 514 | simInt simSetJointDependency(simInt jointHandle,simInt masterJointHandle,simFloat offset,simFloat coeff);
|
519 | 515 | simInt simSetStringNamedParam(const simChar* paramName,const simChar* stringParam,simInt paramLength);
|
520 | 516 | simChar* simGetStringNamedParam(const simChar* paramName,simInt* paramLength);
|
| 517 | +simChar* simGetUserParameter(simInt objectHandle,const simChar* parameterName,simInt* parameterLength); |
| 518 | +simInt simSetUserParameter(simInt objectHandle,const simChar* parameterName,const simChar* parameterValue,simInt parameterLength); |
521 | 519 |
|
522 | 520 |
|
523 | 521 |
|
|
700 | 698 | simInt simLoadUI(const simChar* filename,simInt maxCount,simInt* uiHandles);
|
701 | 699 | simInt simSaveUI(simInt count,const simInt* uiHandles,const simChar* filename);
|
702 | 700 | simInt simHandleGeneralCallbackScript(simInt callbackId,simInt callbackTag,simVoid* additionalData);
|
703 |
| -//simInt simRegisterCustomLuaFunction(const simChar* funcName,const simChar* callTips,const simInt* inputArgumentTypes,simVoid(*callBack)(struct SLuaCallBack* p)); |
704 | 701 | simInt simRegisterCustomLuaVariable(const simChar* varName,const simChar* varValue);
|
705 | 702 | simInt simRegisterContactCallback(simInt(*callBack)(simInt,simInt,simInt,simInt*,simFloat*));
|
706 | 703 | simInt simRegisterJointCtrlCallback(simInt(*callBack)(simInt,simInt,simInt,const simInt*,const simFloat*,simFloat*));
|
707 | 704 | simInt simGetMechanismHandle(const simChar* mechanismName);
|
708 | 705 | simInt simHandleMechanism(simInt mechanismHandle);
|
709 | 706 | simInt simHandleCustomizationScripts(simInt callType);
|
710 |
| -//simInt simCallScriptFunction(simInt scriptHandleOrType,const simChar* functionNameAtScriptName,SLuaCallBack* data,const simChar* reservedSetToNull); |
| 707 | +simInt simSetVisionSensorFilter(simInt visionSensorHandle,simInt filterIndex,simInt options,const simInt* pSizes,const simUChar* bytes,const simInt* ints,const simFloat* floats,const simUChar* custom); |
| 708 | +simInt simGetVisionSensorFilter(simInt visionSensorHandle,simInt filterIndex,simInt* options,simInt* pSizes,simUChar** bytes,simInt** ints,simFloat** floats,simUChar** custom); |
| 709 | +simChar* simGetScriptSimulationParameter(simInt scriptHandle,const simChar* parameterName,simInt* parameterLength); |
| 710 | +simInt simSetScriptSimulationParameter(simInt scriptHandle,const simChar* parameterName,const simChar* parameterValue,simInt parameterLength); |
711 | 711 | // Deprecated end
|
712 | 712 |
|
713 | 713 | """)
|
|
716 | 716 | cffi_path = os.path.join(cwd, 'cffi_build')
|
717 | 717 |
|
718 | 718 | ffibuilder.set_source(
|
719 |
| - "pyrep.backend._v_rep_cffi", |
| 719 | + "pyrep.backend._sim_cffi", |
720 | 720 | """
|
721 |
| - #include "v_rep.h" // the C header of the library |
| 721 | + #include "sim.h" // the C header of the library |
722 | 722 | """,
|
723 |
| - libraries=['v_rep'], |
724 |
| - library_dirs=[os.environ['VREP_ROOT']], |
| 723 | + libraries=['coppeliaSim'], |
| 724 | + library_dirs=[os.environ['COPPELIASIM_ROOT']], |
725 | 725 | include_dirs=[cffi_path])
|
726 | 726 |
|
727 | 727 | # For some reason, cffi makes it such that it looks for libv_rep.so.1
|
728 | 728 | # rather than libv_rep.so. So we add a symlink.
|
729 |
| -path = os.path.join(os.environ['VREP_ROOT'], 'libv_rep.so') |
| 729 | +path = os.path.join(os.environ['COPPELIASIM_ROOT'], 'libcoppeliaSim.so') |
730 | 730 | if not os.path.exists(path + '.1'):
|
731 | 731 | print('creating symlink: %s -> %s' % (path + '.1', path))
|
732 | 732 | os.symlink(path, path + '.1')
|
733 | 733 |
|
734 | 734 | # Copy lua functions to the VREP_ROOT
|
735 |
| -print('copying lua file: %s -> %s' % ('pyrep/backend', os.environ['VREP_ROOT'])) |
736 |
| -lua_script_fname = 'vrepAddOnScript_PyRep.lua' |
| 735 | +print('copying lua file: %s -> %s' % ('pyrep/backend', |
| 736 | + os.environ['COPPELIASIM_ROOT'])) |
| 737 | +lua_script_fname = 'simAddOnScript_PyRep.lua' |
737 | 738 | copyfile(os.path.join('pyrep/backend', lua_script_fname),
|
738 |
| - os.path.join(os.environ['VREP_ROOT'], lua_script_fname)) |
| 739 | + os.path.join(os.environ['COPPELIASIM_ROOT'], lua_script_fname)) |
739 | 740 |
|
740 | 741 | if __name__ == "__main__":
|
741 | 742 | ffibuilder.compile(verbose=True)
|
0 commit comments