Drake
drake::common Namespace Reference

Namespaces

 test
 

Functions

void CallPythonInit (const std::string &filename)
 Initializes CallPython for a given file. More...
 
template<typename... Types>
PythonRemoteVariable CallPython (const std::string &function_name, Types... args)
 Calls a Python client with a given function and arguments, returning a handle to the result. More...
 
template<typename... Types>
PythonRemoteVariable ToPythonTuple (Types... args)
 Creates a tuple in Python. More...
 
template<typename... Types>
PythonRemoteVariable ToPythonKwargs (Types... args)
 Creates a keyword-argument list to be unpacked. More...
 
std::string GetRpcPipeTempDirectory ()
 Returns a directory location suitable for temporary files for the call_* clients and libraries. More...
 

Function Documentation

◆ CallPython()

PythonRemoteVariable drake::common::CallPython ( const std::string &  function_name,
Types...  args 
)

Calls a Python client with a given function and arguments, returning a handle to the result.

For example uses, see call_python_test.cc.

◆ CallPythonInit()

void drake::common::CallPythonInit ( const std::string &  filename)

Initializes CallPython for a given file.

If this function is not called, then the filename defaults to /tmp/python_rpc.

Exceptions
std::exceptionIf either this function or CallPython have already been called.

◆ GetRpcPipeTempDirectory()

std::string drake::common::GetRpcPipeTempDirectory ( )

Returns a directory location suitable for temporary files for the call_* clients and libraries.

Returns
The value of the environment variable TEST_TMPDIR if defined or otherwise /tmp. Any trailing / will be stripped from the output.
Exceptions
std::exceptionIf the path referred to by TEST_TMPDIR or /tmp does not exist or is not a directory.

◆ ToPythonKwargs()

PythonRemoteVariable drake::common::ToPythonKwargs ( Types...  args)

Creates a keyword-argument list to be unpacked.

Parameters
argsArgument list in the form of (key1, value1, key2, value2, ...).

◆ ToPythonTuple()

PythonRemoteVariable drake::common::ToPythonTuple ( Types...  args)

Creates a tuple in Python.