40 int main(
int argc,
const char* argv[])
42 std::string serial_device_name =
"/dev/ttyUSB0";
45 controller.
connect(serial_device_name);
48 std::vector<SVHPositionSettings> default_position_settings(
SVH_DIMENSION);
50 -1.0e6f, 1.0e6f, 3.4e3f, 1.00f, 1e-3f, -500.0f, 500.0f, 0.5f, 0.05f, 0.0f);
52 -1.0e6f, 1.0e6f, 8.5e3f, 1.00f, 1e-3f, -500.0f, 500.0f, 0.5f, 0.05f, 0.0f);
54 -1.0e6f, 1.0e6f, 17.0e3f, 1.00f, 1e-3f, -500.0f, 500.0f, 0.5f, 0.05f, 0.0f);
56 default_position_settings[0] = pos_set_thumb;
57 default_position_settings[1] = pos_set_thumb;
58 default_position_settings[2] = pos_set_finger;
59 default_position_settings[3] = pos_set_finger;
60 default_position_settings[4] = pos_set_finger;
61 default_position_settings[5] = pos_set_finger;
62 default_position_settings[6] = pos_set_finger;
63 default_position_settings[7] = pos_set_finger;
64 default_position_settings[8] = pos_set_spread;
67 std::vector<SVHCurrentSettings> default_current_settings(
SVH_DIMENSION);
69 -191.0f, 191.0f, 0.405f, 4e-6f, -300.0f, 300.0f, 0.850f, 85.0f, -254.0f, 254.0f);
71 -176.0f, 176.0f, 0.405f, 4e-6f, -300.0f, 300.0f, 0.850f, 85.0f, -254.0f, 254.0f);
73 -167.0f, 167.0f, 0.405f, 4e-6f, -300.0f, 300.0f, 0.850f, 85.0f, -254.0f, 254.0f);
75 default_current_settings[0] = cur_set_thumb;
76 default_current_settings[1] = cur_set_thumb;
77 default_current_settings[2] = cur_set_distal_joint;
78 default_current_settings[3] = cur_set_proximal_joint;
79 default_current_settings[4] = cur_set_distal_joint;
80 default_current_settings[5] = cur_set_proximal_joint;
81 default_current_settings[6] = cur_set_distal_joint;
82 default_current_settings[7] = cur_set_distal_joint;
83 default_current_settings[8] = cur_set_proximal_joint;
86 std::cout <<
"sending request firmware info" << std::endl;
95 std::cout <<
"sending request controller feedback" << std::endl;
99 std::cout <<
"set position settings" << std::endl;
105 std::cout <<
"set current settings" << std::endl;
111 std::this_thread::sleep_for(std::chrono::seconds(20));
void setPositionSettings(const SVHChannel &channel, const SVHPositionSettings &position_settings)
activate a new set of position controller settings for a specific channel
The SVHCurrentSettings save the current controller paramters for a single motor.
bool connect(const std::string &dev_name)
Open serial device connection.
int main(int argc, const char *argv[])
void requestControllerFeedback(const SVHChannel &channel)
request feedback (position and current) to a specific channel
void setCurrentSettings(const SVHChannel &channel, const SVHCurrentSettings ¤t_settings)
activate a new set of current controller settings for a specific channel
void disconnect()
disconnect serial device
This class controls the the SCHUNK five finger hand.
The SVHPositionSettings save the position controller paramters for a single motor.
void requestFirmwareInfo()
request a transmission of formware information