Skip to content

Commit

Permalink
adjust to descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mamueluth committed May 22, 2024
1 parent 23983a9 commit 7b39570
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions example_1/hardware/rrbot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ hardware_interface::CallbackReturn RRBotSystemPositionOnlyHardware::on_configure
// END: This part here is for exemplary purposes - Please do not copy to your production code

// reset values always when configuring hardware
for (const auto & descr : joint_states_descr_)
for (const auto & descr : joint_states_descriptions_)
{
joint_state_set_value(descr, 0.0);
}
for (const auto & descr : joint_commands_descr_)
for (const auto & descr : joint_commands_descriptions_)
{
joint_command_set_value(descr, 0.0);
}
Expand All @@ -131,7 +131,7 @@ hardware_interface::CallbackReturn RRBotSystemPositionOnlyHardware::on_activate(
// END: This part here is for exemplary purposes - Please do not copy to your production code

// command and state should be equal when starting
for (const auto & descr : joint_states_descr_)
for (const auto & descr : joint_states_descriptions_)
{
joint_command_set_value(descr, joint_state_get_value(descr));
}
Expand Down Expand Up @@ -168,7 +168,7 @@ hardware_interface::return_type RRBotSystemPositionOnlyHardware::read(
// BEGIN: This part here is for exemplary purposes - Please do not copy to your production code
RCLCPP_INFO(rclcpp::get_logger("RRBotSystemPositionOnlyHardware"), "Reading...");

for (const auto & descr : joint_states_descr_)
for (const auto & descr : joint_states_descriptions_)
{
auto new_value = joint_state_get_value(descr) +
(joint_command_get_value(descr) - joint_state_get_value(descr)) / hw_slowdown_;
Expand All @@ -190,7 +190,7 @@ hardware_interface::return_type RRBotSystemPositionOnlyHardware::write(
// BEGIN: This part here is for exemplary purposes - Please do not copy to your production code
RCLCPP_INFO(rclcpp::get_logger("RRBotSystemPositionOnlyHardware"), "Writing...");

for (const auto & descr : joint_commands_descr_)
for (const auto & descr : joint_commands_descriptions_)
{
// Simulate sending commands to the hardware
RCLCPP_INFO_STREAM(
Expand Down

0 comments on commit 7b39570

Please sign in to comment.