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.c File Reference
#include <stdio.h>
#include <FreeRTOS.h>
#include <task.h>
#include <queue.h>
#include <semphr.h>
#include <timers.h>
#include <memPoolService.h>
#include <stdbool.h>
#include <carme_io1.h>
#include "arm.h"
#include "ucan.h"
#include "bcs.h"
Include dependency graph for arm.c:

Go to the source code of this file.

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}