31 #include <boost/test/unit_test.hpp> 47 BOOST_AUTO_TEST_SUITE(ts_SVHDriver)
53 std::cout <<
"Conversion test of Position Settings ....";
66 BOOST_CHECK_EQUAL(test_pos_settings_in, test_pos_settings_out);
68 std::cout <<
"Done" << std::endl;
73 std::cout <<
"Conversion test of Current Settings ....";
79 SVHCurrentSettings test_cur_settings_in(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.1);
86 BOOST_CHECK_EQUAL(test_cur_settings_in, test_cur_settings_out);
88 std::cout <<
"Done" << std::endl;
93 std::cout <<
"Conversion test of Controll Command ....";
106 BOOST_CHECK_EQUAL(test_control_command_in, test_control_command_out);
108 std::cout <<
"Done" << std::endl;
114 std::cout <<
"Conversion test of ControllerFeedback ....";
124 g_payload << test_controller_feedback_in;
125 g_payload >> test_controller_feedback_out;
127 BOOST_CHECK_EQUAL(test_controller_feedback_in, test_controller_feedback_out);
129 std::cout <<
"Done" << std::endl;
134 std::cout <<
"Converstion test of ControllerState ....";
140 SVHControllerState test_controller_state_in(0x001F, 0x001F, 0x0200, 0x02000, 0x0001, 0x0001);
148 BOOST_CHECK_EQUAL(test_controller_state_in, test_controller_state_out);
150 std::cout <<
"Done" << std::endl;
155 std::cout <<
"Converstion test of EncoderSettings ....";
168 BOOST_CHECK_EQUAL(test_encoder_settings_in, test_encoder_settings_out);
170 std::cout <<
"Done" << std::endl;
175 std::cout <<
"Converstion test of ControlCommandAllChannels ....";
188 BOOST_CHECK_EQUAL(test_control_command_in, test_control_command_out);
190 std::cout <<
"Done" << std::endl;
195 std::cout <<
"Converstion test of ControllerFeedbackAllChannels ....";
215 g_payload << test_controller_feedback_all_channels_in;
216 g_payload >> test_controller_feedback_all_channels_out;
218 BOOST_CHECK_EQUAL(test_controller_feedback_all_channels_in,
219 test_controller_feedback_all_channels_out);
221 std::cout <<
"Done" << std::endl;
227 std::cout <<
"Converstion test of Serial Packet ....";
236 SVHPositionSettings test_pos_settings_in(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.1);
244 packet << test_serial_packet_in;
248 packet >> test_serial_packet_out;
253 BOOST_CHECK_EQUAL(test_serial_packet_in, test_serial_packet_out);
254 BOOST_CHECK_EQUAL(test_pos_settings_in, test_pos_settings_out);
258 std::cout <<
"Done" << std::endl;
263 std::cout <<
"Controller receiving feedback Packet ....";
290 BOOST_CHECK_EQUAL(test_controller_feedback, feedback_out);
292 std::cout <<
"Done" << std::endl;
296 BOOST_AUTO_TEST_SUITE_END()
Structure for transmitting all controllcommands at once.
void receivedPacketCallback(const SVHSerialPacket &packet, unsigned int packet_count)
callback function for interpretation of packages
The SVHCurrentSettings save the current controller paramters for a single motor.
const uint8_t SVH_SET_CONTROL_COMMAND
Sets the target position of a channel.
bool getControllerFeedback(const SVHChannel &channel, SVHControllerFeedback &controller_feedback)
request the latest stored controllerfeedback (current, position) from the controller.
std::vector< uint8_t > array
array of template type TArray
std::vector< uint8_t > data
Payload of the package.
The SVHControllerFeedback saves the feedback of a single motor.
ControlCommands are given as a single target position for the position controller (given in ticks) ...
void appendWithoutConversion(const T &data)
add data without any byte conversion
ArrayBuilder g_payload(40)
BOOST_AUTO_TEST_CASE(ConvertPosSettings)
This class controls the the SCHUNK five finger hand.
The SVHPositionSettings save the position controller paramters for a single motor.
void reset(size_t array_size=1)
Resets the Arraybuilder to initial state, all values will be deleted.
The SVHControllerState indicates the current state of the MeCoVis controller IC which is used in the ...
The SVHControllerFeedbackAllChannes saves the feedback of a all motors.
The SVHEncoderSettings hold the settings for the encoder scaling of each channel. ...
The SerialPacket holds the (non generated) header and data of one message to the SVH-Hardware.