-
Notifications
You must be signed in to change notification settings - Fork 37
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
Axis idle on shutdown #31
Axis idle on shutdown #31
Conversation
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.
This seems like a useful feature, thanks for the contribution! Just some small comments.
odrive_node/src/odrive_can_node.cpp
Outdated
struct can_frame frame; | ||
frame.can_id = node_id_ << 5 | CmdId::kSetAxisState; | ||
{ | ||
std::unique_lock<std::mutex> guard(axis_state_mutex_); |
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 mutex was there to guard access to the axis_state_
variable. However since you're using a const here instead, you can remove the lock.
odrive_node/src/odrive_can_node.cpp
Outdated
@@ -49,6 +51,17 @@ ODriveCanNode::ODriveCanNode(const std::string& node_name) : rclcpp::Node(node_n | |||
} | |||
|
|||
void ODriveCanNode::deinit() { | |||
if(axis_idle_on_shutdown_) { |
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.
formatting: if (
@samuelsadok
|
thanks! |
Related issue: #30.
I tested the ODrive S1. After switching to CLOSED_LOOP, I terminated the node. I confirmed that it changed to IDLE.