12 #include <dynamic-graph/factory.h>
27 const double upper_lim(1);
28 const double lower_lim(2);
29 robot_util->set_joint_limits_for_id(1, lower_lim, upper_lim);
30 if (
robot_util->get_joint_limits_from_id(1).upper == upper_lim &&
31 robot_util->get_joint_limits_from_id(1).lower == lower_lim) {
32 std::cout <<
"joint_limits_for_id works !" << std::endl;
34 std::cout <<
"ERROR: joint_limits_for_id does not work !" << std::endl;
36 if (
robot_util->cp_get_joint_limits_from_id(1).upper == upper_lim &&
37 robot_util->cp_get_joint_limits_from_id(1).lower == lower_lim) {
38 std::cout <<
"cp_get_joint_limits_for_id works !" << std::endl;
40 std::cout <<
"ERROR: cp_get_joint_limits_for_id does not work !"
50 std::cout <<
"name_to_id works !" << std::endl;
52 std::cout <<
"ERROR: name_to_id does not work !" << std::endl;
61 urdf_to_sot << 0, 2, 1;
63 if (urdf_to_sot ==
robot_util->m_dgv_urdf_to_sot) {
64 std::cout <<
"urdf_to_sot works !" << std::endl;
66 std::cout <<
"ERROR: urdf_to_sot does not work !" << std::endl;
74 robot_util->joints_sot_to_urdf(q_sot, q_test_urdf);
75 if (q_urdf == q_test_urdf) {
76 std::cout <<
"joints_urdf_to_sot and joints_sot_to_urdf work !"
79 std::cout <<
"ERROR: joints_urdf_to_sot or joints_sot_to_urdf "
88 robot_util->velocity_urdf_to_sot(q2_urdf, v_urdf, v_sot);
89 robot_util->velocity_sot_to_urdf(q2_urdf, v_sot, v_urdf);
90 std::cout <<
"velocity_sot_to_urdf and velocity_urdf_to_sot work !"
96 robot_util->base_urdf_to_sot(base_q_urdf, base_q_sot);
97 robot_util->base_sot_to_urdf(base_q_sot, base_q_urdf);
98 std::cout <<
"base_urdf_to_sot and base_sot_to_urdf work !" << std::endl;
102 robot_util->config_urdf_to_sot(q2_urdf, q2_sot);
103 robot_util->config_sot_to_urdf(q2_sot, q2_urdf);
104 std::cout <<
"config_urdf_to_sot and config_sot_to_urdf work !" << std::endl;
110 const std::string rf(
"rf");
111 const std::string lf(
"lf");
112 const std::string lh(
"lh");
113 const std::string rh(
"rh");
115 robot_util->m_force_util.set_name_to_force_id(rf, 0);
116 robot_util->m_force_util.set_name_to_force_id(lf, 1);
117 robot_util->m_force_util.set_name_to_force_id(lh, 2);
118 robot_util->m_force_util.set_name_to_force_id(rh, 3);
121 lf_lim << 1, 2, 3, 4, 5, 6;
123 uf_lim << 10, 20, 30, 40, 50, 60;
124 robot_util->m_force_util.set_force_id_to_limits(1, lf_lim, uf_lim);
125 if (
robot_util->m_force_util.get_id_from_name(rf) == 0 &&
126 robot_util->m_force_util.get_id_from_name(lf) == 1 &&
127 robot_util->m_force_util.get_id_from_name(lh) == 2 &&
128 robot_util->m_force_util.get_id_from_name(rh) == 3) {
129 std::cout <<
"force_util set and get id_from_name work !" << std::endl;
131 std::cout <<
"ERROR: force_util set and get id_from_name do not work !"
134 if (
robot_util->m_force_util.get_name_from_id(0) == rf &&
135 robot_util->m_force_util.get_name_from_id(1) == lf &&
136 robot_util->m_force_util.get_name_from_id(2) == lh &&
137 robot_util->m_force_util.get_name_from_id(3) == rh) {
138 std::cout <<
"force_util get name_from_id works !" << std::endl;
140 std::cout <<
"ERROR: force_util get name_from_id does not work !"
143 if (
robot_util->m_force_util.get_limits_from_id(1).upper == uf_lim &&
144 robot_util->m_force_util.get_limits_from_id(1).lower == lf_lim) {
145 std::cout <<
"force_util set and get id to limits work !" << std::endl;
147 std::cout <<
"ERROR: force_util set and get id to "
148 "limits works do not work !"