Robowflex  v0.1
Making MoveIt Easy
blender Namespace Reference

Functions

def add_path (path)
 
def initialize_path ()
 
def find_package (package)
 
def initialize_robowflex_path ()
 
def load_ROS_module (module_name, module_file, package="robowflex_visualization")
 

Function Documentation

◆ add_path()

def blender.add_path (   path)
Add a path to the system search path.

Definition at line 21 of file blender.py.

21 def add_path(path):
22  """Add a path to the system search path.
23  """
24  if not path in sys.path:
25  sys.path.append(path)
26  print("Adding path {} to system path.".format(path))
27 
28 
def add_path(path)
Definition: blender.py:21
std::string format(const std::string &fmt, Args &&... args)
Recursion base case, return string form of formatted arguments.
Definition: log.h:60

◆ find_package()

def blender.find_package (   package)
Find a ROS package path.

Definition at line 45 of file blender.py.

45 def find_package(package):
46  """Find a ROS package path.
47  """
48  try:
49  output = subprocess.check_output(["rospack", "find", package])
50  return output.decode().strip()
51 
52  except subprocess.CalledProcessError:
53  print("Unable to find package: `{}`".format(package))
54  return ""
55 
56 
def find_package(package)
Definition: blender.py:45

◆ initialize_path()

def blender.initialize_path ( )
Initialize Blender Python's system path with the system Python's paths.

Definition at line 29 of file blender.py.

29 def initialize_path():
30  """Initialize Blender Python's system path with the system Python's paths.
31  """
32  try:
33  output = subprocess.check_output(
34  ["python3", "-c", "import sys; print('\\n'.join(sys.path))"])
35  paths = output.decode().strip().split('\n')
36 
37  for path in paths:
38  add_path(path)
39 
40  except subprocess.CalledProcessError:
41  print("Unable to call system Python3")
42  return ""
43 
44 
def initialize_path()
Definition: blender.py:29

◆ initialize_robowflex_path()

def blender.initialize_robowflex_path ( )
Adds the robowflex_visualization/src folder to search path.

Definition at line 57 of file blender.py.

58  """Adds the robowflex_visualization/src folder to search path.
59  """
60  directory = find_package("robowflex_visualization")
61  add_path(directory)
62 
63 
def initialize_robowflex_path()
Definition: blender.py:57

◆ load_ROS_module()

def blender.load_ROS_module (   module_name,
  module_file,
  package = "robowflex_visualization" 
)
Load a robowflex visualization module.

Definition at line 64 of file blender.py.

66  package = "robowflex_visualization"):
67  """Load a robowflex visualization module.
68  """
69  directory = find_package(package)
70 
71  spec = importlib.util.spec_from_file_location( #
72  module_name, os.path.join(directory, module_file))
73 
74  module = importlib.util.module_from_spec(spec)
75  spec.loader.exec_module(module)
76 
77