A C program to control the Niryo One robotic arm for simulating electronic voting processes in CoppeliaSim
- Project Overview
- Team Members
- Features
- Project Architecture
- Installation & Setup
- Usage Guide
- File Structure
- API Reference
- Contributing
- Resources
This project is an optional assignment for the Introduction to Programming course in Computer Engineering at UFPE. The objective is to develop a C program that controls the Niryo One robotic arm in the CoppeliaSim simulator to simulate electronic voting processes.
The program reads voting sequences from a text file and translates them into precise robotic movements, where the arm "presses" virtual buttons corresponding to each digit in the voting sequence.
This is the first phase of the robotics project. Only teams that successfully complete the simulation phase will be eligible to proceed to the practical phase using the real Niryo One robot. The project deliverable is a short video (maximum 5 minutes) explaining the developed solution.
Name | GitHub |
---|---|
Artur Vinicius Pereira Fernandes | (arturvpf) |
Nathan Barbosa | (sannathan) |
Felipe Mateus Falcao Barreto | (felipemfb) |
- CoppeliaSim Integration: Seamless connection via remote API
- File-based Input: Reads voting sequences from configurable text files
- Precision Control: Accurate joint positioning for digit selection
- Automatic Reset: Returns to home position after each sequence
- Real-time Feedback: Console logging for operation status
- Modular Architecture: Separate functions for different arm movements
- Error Handling: Robust file I/O and connection management
- Configurable Timing: Adjustable delays for different movement phases
- Easy Calibration: Simple parameter adjustment for different setups
CoppeliaSim Environment
↓
Remote API Connection
↓
C Control Program
↓
Joint Position Commands
↓
Niryo One Simulation
- CoppeliaSim 4.3+ - Download here
- GCC Compiler or compatible C compiler
- CoppeliaSim Remote API library files
-
Install CoppeliaSim
# Download and install CoppeliaSim from official website # Ensure remote API is enabled in the simulation
-
Clone Repository
git clone [repository-url] cd ProjetoExtra-ip
-
Prepare Input Files
# Edit voting_sequences.txt with your desired number sequences echo "12345" > voting_sequences.txt echo "67890" >> voting_sequences.txt
- Start CoppeliaSim and load the Niryo One scene
- Enable Remote API (usually on port 19999)
- Compile the program:
gcc niryo_controller.c -o niryo_controller -I./remoteApi -L./remoteApi -lremoteApi
- Run the controller:
./niryo_controller
- Input File: Modify
voting_sequences.txt
to change voting sequences - Connection Settings: Update IP/port in source code if needed
- Movement Parameters: Adjust joint angles and timing in the arrays
ProjetoExtra-ip/
├── niryo_controller.c # Main robotic arm controller
├── niryo_advanced_controller.c # Advanced version with extended features
├── voting_sequences.txt # Input sequences for voting simulation
├── example_sequences.txt # Additional example input data
├── Main/
│ └── main.c # Alternative main implementation
└── README.md # This documentation file
InitialPosition()
- Moves arm to home/zero positionDefinedPoint()
- Positions arm at reference point (above digit 5)ConfirmVote()
- Executes vote confirmation sequenceVote()
- Executes movement for a specific digit
numj3[]
,numj2[]
,numj1[]
- Joint positions for digits 0-9t1[]
,t2[]
,t3[]
,t4[]
- Timing arrays for movement phases
- Follow consistent C coding standards
- Add comprehensive comments for all functions
- Test thoroughly in simulation before hardware deployment
- Document any parameter changes or calibration updates
- Use GitHub Issues for bug reports
- Include CoppeliaSim version and system information
- Provide input files that reproduce the issue
- CoppeliaSim Download - Get the latest version
- CoppeliaSim Documentation - Complete API reference
- Project Drive Folder - Project details and requirements
- YouTube - CoppeliaSim C Setup - Setup tutorial
- YouTube - Robotics Course Playlist - Complete course
- Project Groups Spreadsheet - Team coordination
This project is developed for educational purposes as part of the Introduction to Programming course in Computer Engineering at UFPE. Feel free to use and modify the code for learning and educational applications.
- Course Instructors - For providing the optional robotics project framework
- CoppeliaSim Team - For the excellent simulation environment
- Niryo Robotics - For the open-source robot platform
- UFPE Computer Engineering Program - For supporting hands-on robotics education
Optional Project - Introduction to Programming Course
Computer Engineering - UFPE
Note: This is the simulation phase of the project. Only teams that successfully complete this phase will be eligible for the practical phase with the real Niryo One robot.