U.B.O.R
The [U]seless [B]ox [O]rganizing [R]obot. A FreeRTOS study project written in C which implements a multitasked control unit for a belt conveyor system with robotic sorting arms.
Macros | Enumerations | Functions | Variables
Arm

Module controlling the robot arms. More...

Macros

#define BUTTON_T0   0x01
 
#define BUTTON_T1   0x02
 
#define BUTTON_T2   0x04
 
#define BUTTON_T3   0x08
 
#define ROBOT_L_STATUS_REQUEST_ID   0x150
 
#define ROBOT_L_STATUS_RETURN_ID   0x151
 
#define ROBOT_L_COMAND_REQUEST_ID   0x152
 
#define ROBOT_L_COMAND_RETURN_ID   0x153
 
#define ROBOT_L_RESET_ID   0x15F
 
#define COMAND_DLC   0x006
 
#define STATUS_REQEST_DLC   0x002
 
#define ROBOT_R_STATUS_REQUEST_ID   0x160
 
#define ROBOT_R_STATUS_RETURN_ID   0x161
 
#define ROBOT_R_COMAND_REQUEST_ID   0x162
 
#define ROBOT_R_COMAND_RETURN_ID   0x163
 
#define ROBOT_R_RESET_ID   0x16F
 
#define MASK_SWITCH_0   0x01
 
#define MASK_SWITCH_1   0x02
 
#define MASK_SWITCH_2   0x04
 
#define MASK_SWITCH_3   0x08
 
#define MASK_SWITCH_4   0x10
 
#define BLOCK_TIME_MIDDLE_POS   200000
 
#define MSG_QUEUE_SIZE   1
 
#define ARM_TASK_PRIORITY   2
 
#define ARM_TASK_STACKSIZE   256
 
#define TASK_DELAY   100
 
#define GRIPPER_MAX   1
 
#define GRIPPER_MIN   0
 

Enumerations

enum  arm_select { arm_left =belt_left, arm_right =belt_right }
 The arm_select enum differenciates between the different arms (left/right) More...
 

Functions

void move_roboter (void *pv_data)
 Task for left and right arm. More...
 
void init_arm ()
 Creates the arm tasks. More...
 
void manual_arm_movement (void *pvData)
 Task to move the roboter with the Buttons. To create this task unkomment it in the function init_arm() More...
 

Variables

CARME_CAN_MESSAGE robot_msg_buffer_right
 
CARME_CAN_MESSAGE robot_msg_buffer_left
 
uint8_t status_request [2] = {0x02,0x00}
 

Detailed Description

Module controlling the robot arms.

Macro Definition Documentation

◆ ARM_TASK_PRIORITY

#define ARM_TASK_PRIORITY   2

Definition at line 75 of file arm.c.

◆ ARM_TASK_STACKSIZE

#define ARM_TASK_STACKSIZE   256

Definition at line 76 of file arm.c.

◆ BLOCK_TIME_MIDDLE_POS

#define BLOCK_TIME_MIDDLE_POS   200000

Definition at line 73 of file arm.c.

◆ BUTTON_T0

#define BUTTON_T0   0x01

Definition at line 44 of file arm.c.

◆ BUTTON_T1

#define BUTTON_T1   0x02

Definition at line 45 of file arm.c.

◆ BUTTON_T2

#define BUTTON_T2   0x04

Definition at line 46 of file arm.c.

◆ BUTTON_T3

#define BUTTON_T3   0x08

Definition at line 47 of file arm.c.

◆ COMAND_DLC

#define COMAND_DLC   0x006

Definition at line 55 of file arm.c.

◆ GRIPPER_MAX

#define GRIPPER_MAX   1

Definition at line 78 of file arm.c.

◆ GRIPPER_MIN

#define GRIPPER_MIN   0

Definition at line 79 of file arm.c.

◆ MASK_SWITCH_0

#define MASK_SWITCH_0   0x01

Definition at line 66 of file arm.c.

◆ MASK_SWITCH_1

#define MASK_SWITCH_1   0x02

Definition at line 67 of file arm.c.

◆ MASK_SWITCH_2

#define MASK_SWITCH_2   0x04

Definition at line 68 of file arm.c.

◆ MASK_SWITCH_3

#define MASK_SWITCH_3   0x08

Definition at line 69 of file arm.c.

◆ MASK_SWITCH_4

#define MASK_SWITCH_4   0x10

Definition at line 70 of file arm.c.

◆ MSG_QUEUE_SIZE

#define MSG_QUEUE_SIZE   1

Definition at line 74 of file arm.c.

◆ ROBOT_L_COMAND_REQUEST_ID

#define ROBOT_L_COMAND_REQUEST_ID   0x152

Definition at line 52 of file arm.c.

◆ ROBOT_L_COMAND_RETURN_ID

#define ROBOT_L_COMAND_RETURN_ID   0x153

Definition at line 53 of file arm.c.

◆ ROBOT_L_RESET_ID

#define ROBOT_L_RESET_ID   0x15F

Definition at line 54 of file arm.c.

◆ ROBOT_L_STATUS_REQUEST_ID

#define ROBOT_L_STATUS_REQUEST_ID   0x150

Definition at line 50 of file arm.c.

◆ ROBOT_L_STATUS_RETURN_ID

#define ROBOT_L_STATUS_RETURN_ID   0x151

Definition at line 51 of file arm.c.

◆ ROBOT_R_COMAND_REQUEST_ID

#define ROBOT_R_COMAND_REQUEST_ID   0x162

Definition at line 62 of file arm.c.

◆ ROBOT_R_COMAND_RETURN_ID

#define ROBOT_R_COMAND_RETURN_ID   0x163

Definition at line 63 of file arm.c.

◆ ROBOT_R_RESET_ID

#define ROBOT_R_RESET_ID   0x16F

Definition at line 64 of file arm.c.

◆ ROBOT_R_STATUS_REQUEST_ID

#define ROBOT_R_STATUS_REQUEST_ID   0x160

Definition at line 60 of file arm.c.

◆ ROBOT_R_STATUS_RETURN_ID

#define ROBOT_R_STATUS_RETURN_ID   0x161

Definition at line 61 of file arm.c.

◆ STATUS_REQEST_DLC

#define STATUS_REQEST_DLC   0x002

Definition at line 56 of file arm.c.

◆ TASK_DELAY

#define TASK_DELAY   100

Definition at line 77 of file arm.c.

Enumeration Type Documentation

◆ arm_select

enum arm_select

The arm_select enum differenciates between the different arms (left/right)

Enumerator
arm_left 

the left arm

arm_right 

the right arm

Definition at line 84 of file arm.c.

Function Documentation

◆ init_arm()

void init_arm ( )

Creates the arm tasks.

public

Parameters
[in]none
Returns
none

Definition at line 323 of file arm.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ manual_arm_movement()

void manual_arm_movement ( void *  pvData)

Task to move the roboter with the Buttons. To create this task unkomment it in the function init_arm()

public

Parameters
[in]*pvDatanot used
Returns
none

Definition at line 358 of file arm.c.

◆ move_roboter()

void move_roboter ( void *  pv_data)

Task for left and right arm.

public

Parameters
[in]*pvDatachose left(0) or right(1) arm
Returns
none

Definition at line 151 of file arm.c.

Here is the caller graph for this function:

Variable Documentation

◆ robot_msg_buffer_left

CARME_CAN_MESSAGE robot_msg_buffer_left

Definition at line 101 of file arm.c.

◆ robot_msg_buffer_right

CARME_CAN_MESSAGE robot_msg_buffer_right

Definition at line 100 of file arm.c.

◆ status_request

uint8_t status_request[2] = {0x02,0x00}

Definition at line 103 of file arm.c.