-
Notifications
You must be signed in to change notification settings - Fork 7
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
Zultron/2022 09 19 rebase for PRs: 5 pdo config #18
Draft
zultron
wants to merge
46
commits into
tormach:foxy-devel
Choose a base branch
from
zultron:zultron/2022-09-19-rebase_for_PRs-5-pdo_config
base: foxy-devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Zultron/2022 09 19 rebase for PRs: 5 pdo config #18
zultron
wants to merge
46
commits into
tormach:foxy-devel
from
zultron:zultron/2022-09-19-rebase_for_PRs-5-pdo_config
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fix test_dot test. External projects may have mgr classes without a separate category, i.e. in the `all` class, which causes collisions. I'm not sury why this was ever this way in the first place. Other changes for cleanliness only; nothing fixed: - Remove redundant piece of conditional - Improve assertion exception messages
...and `update()` that interface from `get_feedback()`. This fixes issues with the manager class. It also shows that for a more intuitive interface, interfaces should be reset from a `reset()` method in the base `read()`, and `update()` renamed to `set()`.
Will be used by subclasses
When dumping drive params, uploading some objects is expected to fail; suppressing stderr silences the cryptic & out of context error messages printed by the `ethercat` command
The `dump_param_values()` method uploads all device SDO values and returns in a dict of `{sdo_obj : value}` pairs.
Remove unneeded fixtures
The dash character in e.g. `-1` confuses the `ethercat` utility. Fix up the `ethercat download` command to explicitly signal the end of options.
The `LCECCommand.upload()` method can now handle string types.
The `munge_config()` method was too rigid, requiring each key to be named. It also clobbered bits of the original. Instead, copy the whole raw device config, avoiding skipped and clobbered keys, and munge just the bits that need munging.
Add objects shown in manual (and seen on drives) but not in original ESI from Inovance - 2002-06h, 2002-07h: Stop mode settings - 2004-18h: Forced DO output in non-OP state - 2005-08h, 2005-0Ah: Electronic gear ratio settings - 200D-03h: Offline autotuning setting
The `index` attribute was unused other than to compute pin names in the `HALDevice` class. Replace it with a generic string used for generated identifiers.
The base `Device` class `index` attribute, unused outside this class, was removed. Generate HAL pins by munging the `address` attribute instead.
LinuxCNC doesn't support these
Add a general `ConfigIO` class. It covers several cases, broken down into categories: - Config file source: - POSIX path for reading or writing - Python `importlib` resource (possibly in an "egg" zip file) - Config file use case: - Open as IOStream object (can use as context manager; has `read()`, etc. methods) - Read (path + resource) or write (path only) YAML data This will clean up config data handling for both the device manager classes and their tests. It makes sharing config data from package resources easier, both internally within this package, and also for use by external packages (the latter being the main motivation for this change).
Following previous commit for `errors`.
Command and config classes don't have access to device class `name` attribute. This was a design error.
- Generate device config as class method - Update test data for self-consistency
Real device configs should be usable in tests
In addition to YAML configs, also move XML ESI files. Some rework in `hw_device_mgr.ethercat.xml_reader.EtherCATXMLReader` needed to support this. Use logger instead of `print()` in ESI parser so scripts can control output.
To best generate lcec `ethercat.xml` files, the device's distributed clock config should come from the ESI file. Adding that showed that the ESI reading methods were tied to the SDO parser and not reusable. Those are now separated out into `classmethod`s, and cached as well. Also, added more complete plumbing for the XML parser `LcId` param.
- Improve ESI Dc OpMode test cases - Add DC test YAML data
ESI descriptions may have `TxPdo` or `RxPdo` elements with `Entry` subelements referring to dictionary objects not in the `Dictionary` definition. This commit parses those entries and adds them to the SDO list. It also adds default datatypes for an ESI with no `Dictionary` definition at all. Still missing is parsing the PDO mapping from those elements. Also: - Add `BITARR8` data type (iTegva) - Clean up int formatting - Add extra sanity checks
- Add PDO mapping objects to `BogusServo.xml` - Add note to `BogusIO.xml`
…-19-rebase_for_PRs-3-minor-core
…ltron/2022-09-19-rebase_for_PRs-4-config_io
…tron/2022-09-19-rebase_for_PRs-5-pdo_config
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is 5 of 9 in a series of PRs refactoring the
hw_device_mgr
to run outside ROS, handle file resources more intelligently, manage PDO configurations, improve abstraction, improve CiA402 homing, simplify initialization, fix astate_cmd
race condition, and other fixes and improvements.This PR is based on & should be merged after #17 .
This fifth PR adds the ability to configure device PDOs (and DCs) from the
device_config.yaml
. Abstract support extends down to thecia_301
module; theethercat
module implements extra ESI parsing needed to configure a PDO; and thelcec
module implements writing anethercat.conf.xml
configuration file.