Add premake support to build pybullet, Windows and Linux tested, will enable Mac in next commit.
Expose inverse dynamics to Bullet shared memory API, through b3CalculateInverseDynamicsCommandInit and b3GetStatusInverseDynamicsJointForces command/status. See PhysicsClientExeample or pybullet for usage. Add option for Windows and Linux to set python_lib_dir and python_include_dir for premake and --enable_pybullet option Expose inverse dynamics to pybullet: [force] = p.calculateInverseDynamics(objectIndex,[q],[qdot],[acc]) Thanks to Jeff Bingham for the suggestion.
This commit is contained in:
@@ -85,12 +85,36 @@
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "python",
|
||||
description = "Enable Python scripting (experimental, use Physics Server in Example Browser). "
|
||||
trigger = "enable_pybullet",
|
||||
description = "Enable high-level Python scripting of Bullet with URDF/SDF import and synthetic camera."
|
||||
}
|
||||
|
||||
if os.is("Linux") then
|
||||
default_python_include_dir = "/usr/include/python2.7"
|
||||
default_python_lib_dir = "/usr/local/lib/"
|
||||
end
|
||||
|
||||
|
||||
if os.is("Windows") then
|
||||
default_python_include_dir = "C:/Python34/include"
|
||||
default_python_lib_dir = "C:/Python34/libs"
|
||||
end
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "python_include_dir",
|
||||
value = default_python_include_dir,
|
||||
description = "Python (2.x or 3.x) include directory"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "python_lib_dir",
|
||||
value = default_python_lib_dir,
|
||||
description = "Python (2.x or 3.x) library directory "
|
||||
}
|
||||
|
||||
|
||||
newoption {
|
||||
trigger = "targetdir",
|
||||
value = "path such as ../bin",
|
||||
@@ -140,7 +164,7 @@
|
||||
platforms {"x32"}
|
||||
end
|
||||
else
|
||||
platforms {"x32", "x64"}
|
||||
platforms {"x64"}
|
||||
end
|
||||
|
||||
configuration {"x32"}
|
||||
@@ -191,6 +215,14 @@
|
||||
targetdir( _OPTIONS["targetdir"] or "../bin" )
|
||||
location("./" .. act .. postfix)
|
||||
|
||||
if not _OPTIONS["python_include_dir"] then
|
||||
_OPTIONS["python_include_dir"] = default_python_include_dir
|
||||
end
|
||||
|
||||
if not _OPTIONS["python_lib_dir"] then
|
||||
_OPTIONS["python_lib_dir"] = default_python_lib_dir
|
||||
end
|
||||
|
||||
|
||||
projectRootDir = os.getcwd() .. "/../"
|
||||
print("Project root directory: " .. projectRootDir);
|
||||
@@ -222,7 +254,7 @@
|
||||
if _OPTIONS["lua"] then
|
||||
include "../examples/ThirdPartyLibs/lua-5.2.3"
|
||||
end
|
||||
if _OPTIONS["python"] then
|
||||
if _OPTIONS["enable_pybullet"] then
|
||||
include "../examples/pybullet"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user