Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

g_code_logger #56

Closed
wants to merge 14 commits into from
Closed

g_code_logger #56

wants to merge 14 commits into from

Conversation

philipp1604
Copy link
Collaborator

@philipp1604 philipp1604 commented May 6, 2024

Description

This pull request implements the GCodeLogger, which serves as the counterpart to the GCodeProcessor, enabling the tracking of robot movement in G-Code format. The changes include the addition of the GCodeLogger class and the demonstration method g_code_logger_dem.py. Additionally, the class has been thoroughly tested with the test_g_code_logger.py file.

The GCodeLogger class holds two main functionalities:

  1. Logging G-Code: The class can monitor the current positions of the robot and track any changes noticed in the position. Documentation is provided with two different types of G-Codes, following the same style as in the GCodeProcessor. The g_code_robot_view tracks the position using Cartesian coordinates, while the g_code_joint_position tracks the G-Code with the angle of the robot joints.

  2. Writing G-Code: The class is capable of writing the G-Code to a text file from the g_code variable. The method for writing G-Code follows the correct order of the elements in the G-Code.

The demonstration method runs and tracks the robot-view and joint-position G-Code of an input G-Code. The tracked G-Codes are played in order to demonstrate usability. Furthermore, an alternative for tracking G-Code is presented at the end of the main method.

Motivation and Context

The motivation behind the GCodeLogger was to have a counterpart to the GCodeProcessor, enabling the tracking of robot movement in the G-Code format. The classes are designed to work together seamlessly. With the addition of the GCodeLogger, it becomes easier to apply simulation sequences in the real-world environment, as the created G-Code can be immediately utilized.

How has this been tested?

Every method has been tested in the test_g_code_logger.py file. The write_g_code method writes pseudo G-Code to a temporary file and compares the output to the desired result. The update_g_code methods are tested by comparing the tracked G-Code to the position that the robot was moved to. To ensure proper comparison of positions, the tracked G-Code is rounded.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

philipp1604 and others added 14 commits April 4, 2024 18:28
- this is the g_code logger class which has been moved from another project
- slight changes to the Logger Class
- the function for rounding decimals has been removed because it caused errors when running the G_Code
- the ability to round decimals will be implemented in the G-Code Simplifier
For creating the full GCodeLogger Class current changes from the GCodeProcessor have been moved to the Logger branch.
- there has been an error accuring with the joint limits if they have been slightly out of bounds
- therefore a joint limit ajduster has been implemented
- the adjuster checks if there has been a joint position recorded higher than the limits of the joint
- moving GCodeLogger into src file
- changing the structure of the GCodeLogger
- removing unused methods
- changing methods to private
- full implementation of GCodeLogger Class, Demonstration & Test Class
- this is the full version ready for a pull request
- changing the G1 entry for the Joint Position GCode
- last checks did not work maybe due to a bug
- leave robot_base unchanged
- undo changes robot_base
@philipp1604 philipp1604 changed the title GCodeLogger g_code_logger May 6, 2024
@philipp1604 philipp1604 closed this May 6, 2024
@philipp1604 philipp1604 deleted the GCodeLogger branch May 6, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant