-
Notifications
You must be signed in to change notification settings - Fork 3
Cs 178 can open #93
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
base: devel
Are you sure you want to change the base?
Cs 178 can open #93
Conversation
…the findObjectByName function
return getDefaultConfigDir() + "candletoolco.ini"; | ||
} | ||
|
||
inline bool fileExists(const std::string& filepath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to use std::filesystem::path instead of string as windows cli has a different encoding for its paths than regular strings
} | ||
} | ||
|
||
MDCO::Error_t MDCO::writeOpenRegisters(const std::string& name, u32 data, u8 size, bool force) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want no type safety (converting anything to u32 with arbitrary size) we should at least provide helper functions with bit casts in order for the user to not be forced to do convoluted conversions themselves.
index=0x6077 | ||
subindex=0x00 | ||
|
||
# Display torque actual value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The motor should also demonstrate some kind of rotation in the impedance mode example
|
||
// kp | ||
u32 kp_bits; | ||
memcpy(&kp_bits, &(kp), sizeof(float)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
memcpy should not be necessary for common API tasks
examples/py/mdco_motor_detection.py
Outdated
|
||
# make blink each driver led in ascending order | ||
for i in range(len(ids)): | ||
md = pc.MDCO(ids[i], candle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
semicolon at the end is invalid
cmake_minimum_required(VERSION 3.8) | ||
|
||
# Shared sources | ||
set(COMMON_SOURCES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the sources are used by examples they should be located in the candlelib as it is the main interaction point for the users an their API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some architectural relocating is required as well as user API needs some more helper functions in order to make reading/writing possible without manual serialization and deserialization
return oss.str(); | ||
} | ||
|
||
std::string toHex(u32 val, int width = 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those function (this and the one above) should be put under mab namespace to not collide with users code. More over they are very similar, one can be used to run another which lessens the complexity or they may even be one and the same function.
Features: