mirror of
https://github.com/EECS-467-W20-RRRobot-Project/RRRobot.git
synced 2025-08-27 18:12:44 +00:00
Merge branch 'GEAR_arm_controller' of https://github.com/EECS-467-W20-RRRobot-Project/RRRobot into GEAR_arm_controller
This commit is contained in:
@@ -12,9 +12,9 @@
|
|||||||
<iyz>0</iyz>
|
<iyz>0</iyz>
|
||||||
<izz>0.166667</izz>
|
<izz>0.166667</izz>
|
||||||
</inertia>
|
</inertia>
|
||||||
<pose frame=''>0 0 0 0 -0 0</pose>
|
<pose frame=''>0.02 -0.05 0.023 0 -0 0</pose>
|
||||||
</inertial>
|
</inertial>
|
||||||
<pose frame=''>0 0 0 1.5708 -0 0</pose>
|
<pose frame=''>-0 0 0.08 1.5708 -0 0</pose>
|
||||||
<gravity>1</gravity>
|
<gravity>1</gravity>
|
||||||
<self_collide>0</self_collide>
|
<self_collide>0</self_collide>
|
||||||
<kinematic>0</kinematic>
|
<kinematic>0</kinematic>
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include <ros/ros.h>
|
#include <ros/ros.h>
|
||||||
|
|
||||||
@@ -37,6 +38,9 @@
|
|||||||
#include "topic_names.h"
|
#include "topic_names.h"
|
||||||
#include "rrrobot/arm_command.h"
|
#include "rrrobot/arm_command.h"
|
||||||
|
|
||||||
|
using std::cout;
|
||||||
|
using std::endl;
|
||||||
|
|
||||||
class Position
|
class Position
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -88,6 +92,8 @@ public:
|
|||||||
// tell the arm to move to grab the object
|
// tell the arm to move to grab the object
|
||||||
publish_arm_command();
|
publish_arm_command();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
void gripper_state_callback(const osrf_gear::VacuumGripperState &state)
|
void gripper_state_callback(const osrf_gear::VacuumGripperState &state)
|
||||||
@@ -110,6 +116,8 @@ public:
|
|||||||
|
|
||||||
// store current state
|
// store current state
|
||||||
gripper_state = state;
|
gripper_state = state;
|
||||||
|
|
||||||
|
print_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
void grasp_pose_callback(const geometry_msgs::Pose &grasp_pose)
|
void grasp_pose_callback(const geometry_msgs::Pose &grasp_pose)
|
||||||
@@ -131,6 +139,8 @@ public:
|
|||||||
|
|
||||||
publish_arm_command();
|
publish_arm_command();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -193,6 +203,23 @@ private:
|
|||||||
cmd.request.power = power;
|
cmd.request.power = power;
|
||||||
conveyor_pub.call(cmd);
|
conveyor_pub.call(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void print_state()
|
||||||
|
{
|
||||||
|
if (current_robot_state & RobotState::WAITING_FOR_CLASSIFICATION)
|
||||||
|
{
|
||||||
|
cout << "Waiting for classification\t";
|
||||||
|
}
|
||||||
|
if (current_robot_state & RobotState::WAITING_FOR_GRAB_LOCATION)
|
||||||
|
{
|
||||||
|
cout << "Waiting for grab location\t";
|
||||||
|
}
|
||||||
|
if (current_robot_state & RobotState::MOVING_ARM)
|
||||||
|
{
|
||||||
|
cout << "Moving Arm\t";
|
||||||
|
}
|
||||||
|
cout << endl;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
Reference in New Issue
Block a user