-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRobotModelLoader.lua
More file actions
45 lines (36 loc) · 1 KB
/
RobotModelLoader.lua
File metadata and controls
45 lines (36 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
local ffi = require 'ffi'
local torch = require 'torch'
local moveit = require 'moveit.env'
local utils = require 'moveit.utils'
local ros = require 'ros'
local std = ros.std
local RobotModelLoader = torch.class('moveit.RobotModelLoader', moveit)
local f
function init()
local RobotModelLoader_method_names = {
"new",
"delete",
"release",
"getModel",
"getRobotDescription"
}
f = utils.create_method_table("moveit_RobotModelLoader_", RobotModelLoader_method_names)
end
init()
function RobotModelLoader:__init(robot_description, load_kinematics_solvers)
self.o = f.new(robot_description or "robot_description", load_kinematics_solvers or true)
end
function RobotModelLoader:cdata()
return self.o
end
function RobotModelLoader:release()
f.release(self.o)
end
function RobotModelLoader:getModel()
local model = moveit.RobotModel()
f.getModel(self.o, model:cdata())
return model
end
function RobotModelLoader:getRobotDescription()
return ffi.string(f.getRobotDescription(self.o))
end