@@ -20,17 +20,59 @@ void define_barrier(py::module_& m)
2020{
2121 py::class_<Barrier, PyBarrier, std::shared_ptr<Barrier>>(m, " Barrier" )
2222 .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" )
2435 .def (
2536 " 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" )
2748 .def (
2849 " 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" );
3172
3273 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]." )
3476 .def (py::init ());
3577
3678 m.def (
0 commit comments