updated hunter state variable name

This commit is contained in:
Ruixiang Du
2020-06-01 19:03:26 +08:00
parent d5b3da58da
commit 97836c71ca
3 changed files with 3 additions and 3 deletions

View File

@@ -81,7 +81,7 @@ int main(int argc, char **argv)
std::cout << "count: " << count << std::endl;
std::cout << "control mode: " << static_cast<int>(state.control_mode) << " , base state: " << static_cast<int>(state.base_state) << std::endl;
std::cout << "battery voltage: " << state.battery_voltage << std::endl;
std::cout << "velocity (linear, angular): " << state.linear_velocity << ", " << state.angular_velocity << std::endl;
std::cout << "velocity (linear, angular): " << state.linear_velocity << ", " << state.steering_angle << std::endl;
std::cout << "-------------------------------" << std::endl;
sleep(1);

View File

@@ -37,7 +37,7 @@ struct HunterState
// motion state
double linear_velocity = 0;
double angular_velocity = 0;
double steering_angle = 0;
};
struct HunterMotionCmd

View File

@@ -202,7 +202,7 @@ void HunterBase::UpdateHunterState(const HunterMessage &status_msg,
static_cast<uint16_t>(msg.data.status.linear_velocity.high_byte)
<< 8) /
1000.0;
state.angular_velocity =
state.steering_angle =
static_cast<int16_t>(
static_cast<uint16_t>(msg.data.status.angular_velocity.low_byte) |
static_cast<uint16_t>(msg.data.status.angular_velocity.high_byte)