To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 59020387 authored by beuchatp's avatar beuchatp
Browse files

Added squat functions to picker and connected to GUI button. Also added...

Added squat functions to picker and connected to GUI button. Also added parameters for object thickness at pickup and put down locations
parent 7991f7d2
......@@ -125,7 +125,8 @@
#define PICKER_BUTTON_PICKUP 3
#define PICKER_BUTTON_GOTOEND 4
#define PICKER_BUTTON_PUTDOWN 5
#define PICKER_BUTTON_DISCONNECT 6
#define PICKER_BUTTON_SQUAT 6
#define PICKER_BUTTON_DISCONNECT 7
#define PICKER_BUTTON_1 11
#define PICKER_BUTTON_2 12
......@@ -220,6 +221,7 @@ private slots:
void on_picker_pickup_button_clicked();
void on_picker_gotoend_button_clicked();
void on_picker_putdown_button_clicked();
void on_picker_squat_button_clicked();
void on_picker_disconnect_button_clicked();
void on_picker_1_button_clicked();
void on_picker_2_button_clicked();
......
......@@ -1830,6 +1830,11 @@ void MainWindow::on_picker_putdown_button_clicked()
// Call the function that sends the message
send_picker_button_clicked_message(PICKER_BUTTON_PUTDOWN);
}
void MainWindow::on_picker_squat_button_clicked()
{
// Call the function that sends the message
send_picker_button_clicked_message(PICKER_BUTTON_SQUAT);
}
void MainWindow::on_picker_disconnect_button_clicked()
{
// Call the function that sends the message
......
......@@ -92,7 +92,8 @@
#define PICKER_BUTTON_PICKUP 3
#define PICKER_BUTTON_GOTOEND 4
#define PICKER_BUTTON_PUTDOWN 5
#define PICKER_BUTTON_DISCONNECT 6
#define PICKER_BUTTON_SQUAT 6
#define PICKER_BUTTON_DISCONNECT 7
#define PICKER_BUTTON_1 11
#define PICKER_BUTTON_2 12
......@@ -171,6 +172,12 @@ float m_mass_H_grams;
// > Total mass of the Crazyflie plus whatever it is carrying, in [grams]
float m_mass_total_grams;
// Thickness of the object at pick-up and put-down, in [meters]
// > This should also account for extra height due to
// the surface where the object is
float m_thickness_of_object_at_pickup;
float m_thickness_of_object_at_putdown;
// (x,y) coordinates of the pickup location
std::vector<float> m_pickup_coordinates_xy(2);
......@@ -371,6 +378,7 @@ void buttonPressed_connect();
void buttonPressed_pickup();
void buttonPressed_gotoEnd();
void buttonPressed_putdown();
void buttonPressed_squat();
void buttonPressed_disconnect();
void buttonPressed_1();
......
......@@ -5,6 +5,12 @@ mass_E : 3.2
mass_T : 2.9
mass_H : 3.3
# Thickness of the object at pick-up and put-down, in [meters]
# > This should also account for extra height due to
# the surface where the object is
thickness_of_object_at_pickup : 0.02
thickness_of_object_at_putdown : 0.03
# (x,y) coordinates of the pickup location
pickup_coordinates_xy : [-0.3, 0.0]
......
......@@ -159,7 +159,8 @@ void buttonPressed_connect()
{
ROS_INFO("[PICKER CONTROLLER] Connect button pressed");
m_setpoint[2] = m_picker_string_length + 0.02;
m_shouldSmoothSetpointChanges = true;
m_setpoint[2] = m_picker_string_length + m_thickness_of_object_at_pickup;
publishCurrentSetpoint();
}
......@@ -167,6 +168,7 @@ void buttonPressed_pickup()
{
ROS_INFO("[PICKER CONTROLLER] Pick up button pressed");
m_shouldSmoothSetpointChanges = true;
m_mass_total_grams = m_mass_CF_grams + m_mass_E_grams;
m_setpoint[2] = m_picker_string_length + 0.25;
publishCurrentSetpoint();
......@@ -176,6 +178,7 @@ void buttonPressed_gotoEnd()
{
ROS_INFO("[PICKER CONTROLLER] Goto End button pressed");
m_shouldSmoothSetpointChanges = true;
m_setpoint[0] = m_dropoff_coordinates_xy_for_E[0];
m_setpoint[1] = m_dropoff_coordinates_xy_for_E[1];
publishCurrentSetpoint();
......@@ -185,7 +188,18 @@ void buttonPressed_putdown()
{
ROS_INFO("[PICKER CONTROLLER] Put down button pressed");
m_setpoint[2] = m_picker_string_length + 0.02;
m_shouldSmoothSetpointChanges = true;
m_setpoint[2] = m_picker_string_length + m_thickness_of_object_at_putdown;
m_mass_total_grams = m_mass_CF_grams;
publishCurrentSetpoint();
}
void buttonPressed_squat()
{
ROS_INFO("[PICKER CONTROLLER] Squat button pressed");
m_shouldSmoothSetpointChanges = true;
m_setpoint[2] = m_picker_string_length - 0.10;
m_mass_total_grams = m_mass_CF_grams;
publishCurrentSetpoint();
}
......@@ -968,6 +982,9 @@ void buttonPressedCallback(const std_msgs::Int32& msg)
case PICKER_BUTTON_PUTDOWN:
buttonPressed_putdown();
break;
case PICKER_BUTTON_SQUAT:
buttonPressed_squat();
break;
case PICKER_BUTTON_DISCONNECT:
buttonPressed_disconnect();
break;
......@@ -1098,6 +1115,11 @@ void fetchYamlParameters(ros::NodeHandle& nodeHandle)
m_mass_T_grams = getParameterFloat(nodeHandle_for_pickerController , "mass_T");
m_mass_H_grams = getParameterFloat(nodeHandle_for_pickerController , "mass_H");
// Thickness of the object at pick-up and put-down, in [meters]
// > This should also account for extra height due to the surface where the object is
m_thickness_of_object_at_pickup = getParameterFloat(nodeHandle_for_pickerController , "thickness_of_object_at_pickup");
m_thickness_of_object_at_putdown = getParameterFloat(nodeHandle_for_pickerController , "thickness_of_object_at_putdown");
// (x,y) coordinates of the pickup location
getParameterFloatVector(nodeHandle_for_pickerController, "pickup_coordinates_xy", m_pickup_coordinates_xy, 2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment