@@ -20,17 +20,59 @@ void define_barrier(py::module_& m)
20
20
{
21
21
py::class_<Barrier, PyBarrier, std::shared_ptr<Barrier>>(m, " Barrier" )
22
22
.def (py::init<>())
23
- .def (" __call__" , &Barrier::operator (), py::arg (" d" ), py::arg (" dhat" ))
23
+ .def (
24
+ " __call__" , &Barrier::operator (), py::arg (" d" ), py::arg (" dhat" ),
25
+ R"ipc_Qu8mg5v7(
26
+ Evaluate the barrier function.
27
+
28
+ Parameters:
29
+ d: The distance.
30
+ dhat: Activation distance of the barrier.
31
+
32
+ Returns:
33
+ The value of the barrier function at d.
34
+ )ipc_Qu8mg5v7" )
24
35
.def (
25
36
" first_derivative" , &Barrier::first_derivative, py::arg (" d" ),
26
- py::arg (" dhat" ))
37
+ py::arg (" dhat" ),
38
+ R"ipc_Qu8mg5v7(
39
+ Evaluate the first derivative of the barrier function wrt d.
40
+
41
+ Parameters:
42
+ d: The distance.
43
+ dhat: Activation distance of the barrier.
44
+
45
+ Returns:
46
+ The value of the first derivative of the barrier function at d.
47
+ )ipc_Qu8mg5v7" )
27
48
.def (
28
49
" second_derivative" , &Barrier::second_derivative, py::arg (" d" ),
29
- py::arg (" dhat" ))
30
- .def (" units" , &Barrier::units, py::arg (" dhat" ));
50
+ py::arg (" dhat" ),
51
+ R"ipc_Qu8mg5v7(
52
+ Evaluate the second derivative of the barrier function wrt d.
53
+
54
+ Parameters:
55
+ d: The distance.
56
+ dhat: Activation distance of the barrier.
57
+
58
+ Returns:
59
+ The value of the second derivative of the barrier function at d.
60
+ )ipc_Qu8mg5v7" )
61
+ .def (
62
+ " units" , &Barrier::units, py::arg (" dhat" ),
63
+ R"ipc_Qu8mg5v7(
64
+ Get the units of the barrier function.
65
+
66
+ Parameters:
67
+ dhat: Activation distance of the barrier.
68
+
69
+ Returns:
70
+ The units of the barrier function.
71
+ )ipc_Qu8mg5v7" );
31
72
32
73
py::class_<ClampedLogBarrier, Barrier, std::shared_ptr<ClampedLogBarrier>>(
33
- m, " ClampedLogBarrier" )
74
+ m, " ClampedLogBarrier" ,
75
+ " Smoothly clamped log barrier functions from [Li et al. 2020]." )
34
76
.def (py::init ());
35
77
36
78
m.def (
0 commit comments