Drake
Drake C++ Documentation
pydrake_pybind.h File Reference
#include <utility>
#include "pybind11/eigen.h"
#include "pybind11/functional.h"
#include "pybind11/numpy.h"
#include "pybind11/operators.h"
#include "pybind11/pybind11.h"
#include "pybind11/stl.h"
#include "pybind11/stl/filesystem.h"
Include dependency graph for pydrake_pybind.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  overload_cast_impl< Return, Args >
 

Namespaces

 drake
 
 drake::pydrake
 For more high-level information, see the Python Bindings technical notes.
 

Macros

#define PYDRAKE_PREVENT_PYTHON3_MODULE_REIMPORT(variable)
 
#define DRAKE_PYBIND11_NUMPY_OBJECT_DTYPE(Type)   PYBIND11_NUMPY_OBJECT_DTYPE(Type)
 

Typedefs

using py_rvp = py::return_value_policy
 Shortened alias for py::return_value_policy. More...
 

Functions

template<typename PyClass >
void DefCopyAndDeepCopy (PyClass *ppy_class)
 Binds Pythonic __copy__ and __deepcopy__ using class's copy constructor. More...
 
template<typename PyClass >
void DefClone (PyClass *ppy_class)
 Binds Pythonic __copy__ and __deepcopy__ for a class, as well as Clone method, using class's Clone method rather than the copy constructor. More...
 
template<typename Class >
auto ParamInit ()
 Returns a constructor for creating an instance of Class and initializing parameters (bound using def_readwrite). More...
 
void ExecuteExtraPythonCode (py::module m, bool use_subdir=false)
 Executes Python code to introduce additional symbols for a given module. More...
 

Variables

template<typename Return , typename... Args>
constexpr auto overload_cast_explicit = overload_cast_impl<Return, Args...>{}
 Provides option to provide explicit signature when py::overload_cast<Args...> fails to infer the Return argument. More...
 

Macro Definition Documentation

◆ DRAKE_PYBIND11_NUMPY_OBJECT_DTYPE

#define DRAKE_PYBIND11_NUMPY_OBJECT_DTYPE (   Type)    PYBIND11_NUMPY_OBJECT_DTYPE(Type)

◆ PYDRAKE_PREVENT_PYTHON3_MODULE_REIMPORT

#define PYDRAKE_PREVENT_PYTHON3_MODULE_REIMPORT (   variable)
Value:
{ \
static py::handle variable##_original; \
if (variable##_original) { \
variable##_original.inc_ref(); \
variable = py::reinterpret_borrow<py::module>(variable##_original); \
return; \
} else { \
variable##_original = variable; \
} \
}