Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c04d656
added polar coordinates protocol function
Jun 19, 2019
b5a1c25
add debug method
Jun 24, 2019
ff8115b
added by method init a parameter for turning on/off the motors
Jun 24, 2019
7574c41
cleaned up: methods that were not implemented and added commands
Jun 24, 2019
14aa367
edit test environment for mock_bus
Jun 26, 2019
a0e8980
implemented canbus
Jun 26, 2019
e1b7e2d
add debug order and add relative displacement to gcode (coordinate/po…
Jun 26, 2019
1daea7e
added the two methods (relative displacement(xyz/polar)) to uarm class
Jun 26, 2019
31fca85
add attach all joint motors to gcode method
Jun 26, 2019
9d09d42
add method return_cartesian_coordinates_by_speed to uarm_gcode_generator
Jun 26, 2019
edea0b9
add attach_motor_by_id_to_gcode to uarm_gcode_generator class
Jun 26, 2019
66c6ca9
add detach_motor_by_id_to_gcode to uarm_gcode_generator class
Jun 26, 2019
089c086
add check_attached_motor_by_id_to_gcode to uarm_gcode_generator class
Jun 26, 2019
1f7b3db
add set_buzzer_to_gcode to uarm_gcode_generator class
Jun 26, 2019
fb52ce2
add convert_coordinates_to_angle_of_joints_to_gcode to uarm_gcode_gen…
Jun 26, 2019
1e502d1
add convert_angle_of_joints_to_coordinates_to_gcode to uarm_gcode_gen…
Jun 26, 2019
11ab956
add set_current_position_head_to_reference_position_to_gcode to uarm_…
Jun 26, 2019
b77d27e
add attach_all_joint_motors to uarm_swift_pro class
Jun 27, 2019
9a9d50f
add detach_all_joint_motors to uarm_swift_pro class
Jun 27, 2019
0d7b6ed
add attach_motor_by_id to uarm_swift_pro class
Jun 28, 2019
f1748a5
add detach_motor_by_id to uarm_swift_pro class and debug get_buffer b…
Jun 28, 2019
2d6bbe5
add check_attached_motor_by_id to set_buzzer to uarm_swift_pro class
Jun 28, 2019
b5bd0e8
debug set buzzer_to_gcode and added it to uarm_swift_pro
Jun 28, 2019
1dbc218
add convert_coordinates_to_angle_of_joints to set_buzzer to uarm_swif…
Jun 28, 2019
96e32b6
add convert_angle_of_joints_to_coordinates to set_buzzer to uarm_swif…
Jun 28, 2019
c546456
add check_posibility_of_coordinates_cartesian_polar to set_buzzer to …
Jun 28, 2019
3967ab9
add set_current_position_head_to_reference_position to set_buzzer to …
Jun 28, 2019
3d46c26
add querying commands to uarm_gcode_generator.hpp
Jun 28, 2019
d7a9370
add querying commands to uarm_swift_pro class
Jun 29, 2019
32e9f55
add test with mock_bus
Jun 30, 2019
7918212
add documentation in uarm_swift_pro.hpp
Jun 30, 2019
db09e63
deleted debug cout code for testing the mockbus
Jun 30, 2019
12daf0a
add documentation for uarm_gcode_generator.hpp
Jun 30, 2019
1254cb6
Merge branch 'release' into feature-uarm-gcode-protocol
ForgeRoot Jun 30, 2019
ce8decc
resolves bug after resolving merge conflicts
Jun 30, 2019
f8c4fdd
resolve the feedback of PR also I discovered some bugs and discovered…
Jul 1, 2019
b2453aa
add the demo for 3 July and add some end effectors
Jul 3, 2019
b43efe5
add some demo code
Jul 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile.link
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ include $(internal_comm)/Makefile.inc

DATA ?= ../../../libraries/datastructures/code/headers/queue.hpp

#add USART_library
USART ?= ../../../libraries/USART_library
include $(USART)/Makefile.inc


# add hwlib
HWLIB ?= ../../../libraries/hwlib
include $(HWLIB)/Makefile.inc
Expand Down
9 changes: 1 addition & 8 deletions code/headers/dof4_diy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ namespace r2d2::robot_arm {
* @param speed The speed the head moves at
*/
void move_head_to_coordinate(const vector3i_c &coordinate,
uint16_t speed) override;
/**
* @brief
* This function rotates the head of the dof4 diy robot arm.
*
* @param rotation The rotational position the head needs to move to, in degrees.
*/
void rotate_head(int16_t rotation) override;
const uint16_t &speed) override;
};
} // namespace r2d2::robot_arm
10 changes: 6 additions & 4 deletions code/headers/gcode_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <cstddef> // size_t, (u)intx_t
#include <cstdint>
#include <algorithm>
#include <string.h>

namespace r2d2::robot_arm {
/**
Expand Down Expand Up @@ -122,6 +123,10 @@ namespace r2d2::robot_arm {
return buffer;
}

void reset_buffer() {
memset(buffer, 0, sizeof(buffer));
}

/**
* @brief
* Appends a string (source) at the end of the buffer (array)
Expand All @@ -130,9 +135,6 @@ namespace r2d2::robot_arm {
* @param source The string that needs to be added to the end of the buffer
*/
void append(const char *source) {
if (!string_fits(source)) {
return;
}
int i = 0;
size_t start = get_string_length(buffer);
while (source[i]) {
Expand Down Expand Up @@ -176,4 +178,4 @@ namespace r2d2::robot_arm {
virtual void coordinate_to_gcode(const vector3i_c &coordinate,
const uint16_t &speed = 500) = 0;
};
} // namespace r2d2::robot_arm
} // namespace r2d2::robot_arm
27 changes: 18 additions & 9 deletions code/headers/robot_arm_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,30 @@

#include "vector3.hpp"
#include <hwlib.hpp>
#include <base_module.hpp>

/**
* Class robot_arm_interface provides the interface for different robot arms.
*/
namespace r2d2::robot_arm {
class robot_arm_interface_c {
class robot_arm_interface_c: public base_module_c {

public:

robot_arm_interface_c(base_comm_c &comm) : base_module_c(comm){

comm.listen_for_frames({r2d2::frame_type::ROBOT_ARM});
}

void process()override{
comm.request(r2d2::frame_type::ROBOT_ARM);
while (comm.has_data()){
auto frame = comm.get_data();
const auto data = frame.as_frame_type<frame_type::ROBOT_ARM>();
move_head_to_coordinate(vector3i_c(data.x, data.y, data.z), data.speed);

}
}
/**
* @brief
* This function moves the robot arm head to a certain 3d location
Expand All @@ -19,7 +35,7 @@ namespace r2d2::robot_arm {
* @param speed The speed the head moves at
*/
virtual void move_head_to_coordinate(const vector3i_c &coordinate,
uint16_t speed) = 0;
const uint16_t &speed) = 0;

/**
* @brief
Expand All @@ -29,12 +45,5 @@ namespace r2d2::robot_arm {
*/
virtual void move_head_to_coordinate(const vector3i_c &coordinate) = 0;

/**
* @brief
* This function rotates the head of the a robot arm.
*
* @param rotation The rotational position the head needs to move to in degrees
*/
virtual void rotate_head(int16_t rotation) = 0;
};
}; // namespace r2d2::robot_arm
Loading