Skip to content

Commit 05fed13

Browse files
authored
Merge pull request #3 from Preliy/development
Development
2 parents e6e5f3d + 4f4df84 commit 05fed13

File tree

2 files changed

+17
-32
lines changed

2 files changed

+17
-32
lines changed

README.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Key Features:
88
+ Kinematic Solver: Analytical forward and inverse kinematic solvers for different robot types
9-
+ Controller: The main script for robot control, managing kinematics, tool definitions, and reference frames.
9+
+ Controller: The primary script for robot control, responsible for defining the robot's kinematics, tool configurations, and reference frames.
1010

1111
> [!NOTE]
1212
> This package does not include motion planning or trajectory generation functionality
@@ -33,12 +33,12 @@ For custom support or project-specific inquiries, contact us at `preliyex@gmail.
3333
# Sponsoring & Donations
3434
If you find Flange useful, consider supporting the project to help maintain development and improve features:
3535
+ [GitHub Sponsors](https://github.com/sponsors/Preliy)
36-
+ [By Me a Coffee](buymeacoffee.com/preliy)
36+
+ [Buy Me a Coffee](buymeacoffee.com/preliy)
3737

3838
<br>
3939

4040
# Key Components
41-
**Flange** is built on two primary kinematic components: `Frame.cs` and `Joint.cs`. TThese scripts define the kinematic chain and enforce movement constraints.
41+
**Flange** is built on two primary components: `Frame.cs` and `Joint.cs`. These scripts define the kinematic chain and enforce movement constraints.
4242

4343
## Frame
4444
![InspectorFrame.PNG](Documentation/Resources/Images/InspectorFrame.PNG)
@@ -56,20 +56,20 @@ This approach uses [Modified Denavit–Hartenberg (DH)](https://en.wikipedia.org
5656

5757
![FrameJoint.drawio.png](Documentation/Resources/Images/FrameJoint.drawio.png)
5858

59-
A `MechanicalUnit.cs` combines multiple Frames and Joints into a single assembly, such as an arm or external positioner. It provides essential functionality for configuring and controlling the unit:
60-
+ **Custom Control Panel:** Offers a dedicated interface within the Unity editor to configure and manipulate the unit.
61-
+ **Frame and Joint References:** Ensures that all Frames and Joints within the Mechanical Unit are properly referenced to form a complete kinematic chain.
62-
+ **External Control Access:** Includes public methods to control the unit from external scripts.
63-
+ **Save and Load Configurations:** Public methods to save and load configurations for Frames and Joints, enabling the sharing of kinematic chain parameters across different units.
64-
+ **Kinematic Chain Visualization:** When Gizmos are enabled, a visual representation of the kinematic chain is displayed, aiding in understanding and troubleshooting the mechanical structure.
59+
The `MechanicalUnit.cs` integrates multiple frames and joints into a single assembly, such as a robotic arm or an external positioner. It has key functions for configuring and controlling the unit, including:
60+
+ **Custom Inspector:** A single joint value can be controlled using its corresponding slider field.
61+
+ **Frame and Joint References:** All joints and frames must be assigned in sequential chain order.
62+
+ **External Control:** Public methods to control the unit from another scripts.
63+
+ **Save and Load Configurations:** Save and load configurations (Scriptable Object) for Frames and Joints, enabling the sharing of kinematic chain parameters across different prefabs.
64+
+ **Kinematic Chain Visualization:** When Gizmos are enabled, a visual representation of the kinematic chain is displayed.
6565

6666
> [!NOTE]
6767
> Only serial (open chain) kinematic will supported by default
6868
6969
## Robots
7070

71-
`Robot.cs` serves as an abstract base class for various robotic manipulators within the Flange framework.
72-
It establishes a abstract methods for implementing forward (FK) and inverse kinematics (IK) specific to different robot types.
71+
`Robot.cs` serves as an abstract base class for various robotic manipulators within the Flange framework.
72+
It defines abstract methods for forward (FK) and inverse kinematics (IK) that must be implemented by specific robot types.
7373

7474
+ **Kinematics Implementation**:
7575
Forward and inverse kinematics calculations are defined in derived classes, allowing for flexibility in handling different robotic configurations.
@@ -109,20 +109,20 @@ You can find this Robot Prefab in Samples: `Assets/com.preliy.flange/Samples/Dem
109109

110110
## Controller
111111

112-
`Controller.cs` serves as the virtual robot controller within the Flange package, orchestrating key calculations and configurations for robot motion and interaction.
113-
+ **Kinematics Management**: Manages forward and inverse kinematics calculations, accounting for the tool, frames, and robot-specific configuration.
114-
+ **External Unit Integration**: References external units and incorporates their positions into the TCP (Tool Center Point) calculations
112+
`Controller.cs` functions as the virtual robot controller within the Flange package, orchestrating calculations and configurations for robot motion and interaction.
113+
+ **Kinematics Management**: Manages forward and inverse kinematics calculations, taking into account tool parameters, reference frames, and robot-specific configuration.
114+
+ **External Unit Integration**: Includes external unit references and uses their position data for the Tool Center Point (TCP) calculations.
115115

116116
![Controller.PNG](Documentation%2FResources%2FImages%2FController.PNG)
117117

118-
The `Controller.cs` component features a custom inspector UI, allowing users to control the robot through joint values or by directly moving the TCP. In the Cartesian section of the UI, users can view essential properties such as the current TCP position and rotation, the tool, frame, and robot configuration. Additionally, the configuration selection tool includes a "Select" button, enabling users to browse all possible configurations for a specific pose, with the `Show Turn` option providing further configurations that account for axis turns.
118+
The `Controller.cs` component provides a custom inspector that allows to control the robot either by adjusting the joint values or by directly manipulating the TCP. Additionally, the configuration selection tool includes a "Select" button, enabling users to browse all possible configurations for a specific pose, with the `Show Turn` option providing further configurations that account for axis turns.
119119

120-
To use the `Tool` and `Frame` properties, tools and frames must first be assigned in the corresponding lists within `Controller.cs`. The Tool and Frame property indices will reference these lists, allowing the user to select specific tools and frames based on their index values.
120+
To use the `Tool` and `Frame` properties, tools and frames must first be assigned in the corresponding lists within `Controller.cs`. The Tool and Frame property indices will reference these lists, allowing to select specific tools and frames based on their index values.
121121

122122
For kinematic configuration, `Controller.cs` includes three main fields:
123123
+ The **Robot** field, where the robot itself is assigned.
124124
+ The **Base** field, which requires the assignment of a base mechanical unit. This unit acts as the base for the robot, allowing the robot’s reference frame to be moved—for example, along a linear axis.
125-
+ The **External** list, where external mechanical units, such as positioners or rotating tables, can be added to extend the robot’s operational capabilities and coordinate its movements with additional devices.
125+
+ The **External** list, where external mechanical units, such as positioner or rotating table, can be added to extend the robot’s operational capabilities and coordinate its movements with additional devices.
126126

127127
> [!NOTE]
128128
> If the mechanical configuration is modified, the inspector UI must be reloaded. Reselect the Controller GameObject to see the updated Joints Slider list in the inspector.

Runtime/Scripts/Animation/TargetFollower.cs

-15
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ public class TargetFollower : MonoBehaviour
3030

3131
[Header("Settings")]
3232
[SerializeField]
33-
private bool _runInEditor;
34-
[SerializeField]
3533
private bool _showErrorMassage;
3634

3735
[HideInInspector]
@@ -44,23 +42,10 @@ private void OnEnable()
4442
}
4543

4644
private void Update()
47-
{
48-
if (!Application.isPlaying && _runInEditor)
49-
{
50-
_target.Value = transform.GetMatrix();
51-
}
52-
}
53-
54-
private void OnAnimatorMove()
5545
{
5646
_target.Value = transform.GetMatrix();
5747
}
5848

59-
// private void OnValidate()
60-
// {
61-
// _target.Value = transform.GetMatrix();
62-
// }
63-
6449
private void OnDisable()
6550
{
6651
_target.OnValueChanged -= JumpToTarget;

0 commit comments

Comments
 (0)