Skip to content

Commit

Permalink
robot assertive
Browse files Browse the repository at this point in the history
  • Loading branch information
UT AMRL Robot committed Jul 27, 2023
1 parent cc3732e commit 7a590cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/navigation/navigation_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void HumanCallback(const zed_interfaces::ObjectsStamped::ConstPtr& msg) {
auto position = msg->objects[i].position;
std::string label = msg->objects[i].label;
// auto orientation = std::atan2(position[1], position[0]) * (180.0 / M_PI);
if (std::abs(position[0] - current_loc_[0])<2 && std::abs(position[1] - current_loc_[1])<2 && msg->objects[i].label=="Person") { // TODO: Add your own logic here
if (std::abs(position[0] - current_loc_[0])<1 && std::abs(position[1] - current_loc_[1])<1 && msg->objects[i].label=="Person") { // TODO: Add your own logic here
override_human_vel_ = true;
fprintf(stderr, "Velocity: v0: (%f), v1: (%f)\nPosition: p0: (%f), p1: (%f)\nOrientation: (%f degrees)\nLabel: (%s)\n =================",
velocity[0], velocity[1], position[0], position[1], std::atan2(position[1], position[0]) * (180.0 / M_PI), label.c_str());
Expand Down Expand Up @@ -918,7 +918,7 @@ int main(int argc, char** argv) {

// Publish Commands
// TODO: set updated_human_vel accordingly
static float updated_human_vel = 0.5;
static float updated_human_vel = 1.0;
SendCommand(override_human_vel_ ? Eigen::Vector2f::Constant(updated_human_vel) : cmd_vel, cmd_angle_vel);
}
loop.Sleep();
Expand Down

0 comments on commit 7a590cd

Please sign in to comment.