8 #include <arm_parsers/arm_parser.h>
24 ArmParser &arm_hardware_;
42 return arm_hardware_.getEndEffectorTransform();
51 bool grip(
bool grip_action) {
54 int grip_position = 1000;
55 return arm_hardware_.grip(grip_position);
58 int grip_position = 2000;
59 return arm_hardware_.grip(grip_position);
70 arm_hardware_.sendCmd(ArmParser::POWER_ON);
72 arm_hardware_.sendCmd(ArmParser::POWER_OFF);
79 void foldArm() { arm_hardware_.sendCmd(ArmParser::FOLD_ARM); }
84 void rightArm() { arm_hardware_.sendCmd(ArmParser::RIGHT_ARM); }
98 table_writer.
addCell(
"Joint Angles: ");
99 for (
double q : arm_hardware_.getJointAngles()) {
103 table_writer.
addCell(
"Joint Velocities: ");
104 for (
double q : arm_hardware_.getJointVelocities()) {
107 Eigen::Matrix4d ee_transform = arm_hardware_.getEndEffectorTransform();
109 table_writer.
addCell(
"End effector translation: ");
110 for (
int i = 0; i < 3; ++i) {
111 table_writer.
addCell(ee_transform(i, 3));
113 Eigen::Matrix3d ee_rotation = ee_transform.topLeftCorner(3, 3);
114 Eigen::Vector3d euler_angles = ee_rotation.eulerAngles(2, 1, 0);
116 table_writer.
addCell(
"End effector RPY: ");
117 for (
int i = 0; i < 3; ++i) {
118 table_writer.
addCell(euler_angles[i]);
122 std::string command_status_color =
124 table_writer.
addCell(command_status,
"CommandStatus", command_status_color,
127 std::string arm_enabled = (
enabled() ?
"True" :
"False");
129 table_writer.
addCell(arm_enabled,
"Enabled", enabled_color, 2);
146 return arm_hardware_.state == ArmParser::ENABLED ?
true :
false;
static constexpr const char * green
Green color hex code.
Definition: html_utils.h:18
std::string getTableString()
Get the html table in string format.
Definition: html_utils.h:170
std::string getSystemStatus() const
Provide the current state of arm system.
Definition: arm_system.h:93
void foldArm()
Set the arm joints to a known folded configuration.
Definition: arm_system.h:79
bool grip(bool grip_action)
Public API call to grip/ungrip an object.
Definition: arm_system.h:51
Provides functions to switch between active controllers and get goals.
Definition: base_robot_system.h:16
static constexpr const char * blue
Blue color hex code.
Definition: html_utils.h:22
bool getCommandStatus() const
Verify the status of grip/power on/off and fold/rightArm commands.
Definition: arm_system.h:138
bool enabled() const
If arm is enabled return.
Definition: arm_system.h:145
void addCell(const DataT &data, std::string header="", std::string bg_color=Colors::white, int colspan=1)
Add a cell to the table. Should be called after beginning a row. Otherwise will throw an exception...
Definition: html_utils.h:116
void beginRow()
Begin a new row in the table.
Definition: html_utils.h:135
Eigen::Matrix4d getEndEffectorPose()
Public API call to get end effector transform.
Definition: arm_system.h:41
void addHeader(std::string header, std::string text_color=Colors::black, int colspan=1)
Add a table header. Should be called after beginning a row.
Definition: html_utils.h:152
void rightArm()
Set the arm joints to a known L shaped configuration.
Definition: arm_system.h:84
Owns, initializes, and facilitates communication between different hardware/software components...
Definition: arm_system.h:18
Helper class to write html tables to text format.
Definition: html_utils.h:91
void power(bool state)
Power the arm on/off.
Definition: arm_system.h:68
ArmSystem(ArmParser &arm_hardware)
Constructor.
Definition: arm_system.h:35
static constexpr const char * red
Red color hex code.
Definition: html_utils.h:14