Skip to content

Add Extended State Feedback: Effort Reporting & Object Detection - #128

Open
Amineki6 wants to merge 2 commits into
PickNikRobotics:mainfrom
Amineki6:contribution-branch-v2
Open

Add Extended State Feedback: Effort Reporting & Object Detection#128
Amineki6 wants to merge 2 commits into
PickNikRobotics:mainfrom
Amineki6:contribution-branch-v2

Conversation

@Amineki6

Copy link
Copy Markdown

This PR replaces #119 , which was accidentally closed due to a repository visibility update. The changes remain identical.

@peter-mitrano-ar peter-mitrano-ar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start! I'm sure we can get this merged, but I apologize in advance if I am slow to respond. But from testing the basic functionality is mostly there!

I tried running the robotic_control launch file, and I get this:

[ros2_control_node-1] [WARN]: Unable to activate controller 'robotiq_gripper_controller' since the command interface 'robotiq_85_left_knuckle_joint/effort' is not available.

Which makes sense, because it's called set_gripper_max_effort, not effort. Same for velocity. But I was able to fix that in the robotiq_controllers.yaml, so I can push that if you want. In fact, if I have permission, I can push fixes for some of the other commends I made.

However, the output velocity differentiation is not really usable. See the attached plots.
As you can see, the one-step finite difference is incredibly noisy.

Image

Also, I see messages like this, even with the main branch:

[ros2_control_node-1] [WARN]: Overrun detected! The controller manager missed its desired rate of 200 Hz. The loop took 5.797472 ms (missed cycles : 2).

Which is quite concerning, though maybe it's just my set up is weird. Did you test this on real hardware? which ROS version?


uint8_t DefaultDriver::get_object_detection_status()
{
return static_cast<uint8_t>(object_detection_status_);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we missing actually setting this variable? I can't find it... thought somehow it seems to be working


// Read parameters.
gripper_closed_pos_ = stod(info_.hardware_parameters.at("gripper_closed_position"));
gripper_closed_pos_ = stod(info_.hardware_parameters["gripper_closed_position"]);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why switch to [? using at seems safer, because it wil throw an exception instead of creating an default-initialized double value?

Comment on lines +117 to +129
if (joint.state_interfaces.size() != 2 && joint.state_interfaces.size() != 3 && joint.state_interfaces.size() != 4)
{
RCLCPP_FATAL(kLogger, "Joint '%s' has %zu state interface. 2 expected.", joint.name.c_str(),
RCLCPP_FATAL(kLogger, "Joint '%s' has %zu state interface. 2, 3 or 4 expected.", joint.name.c_str(),
joint.state_interfaces.size());
return CallbackReturn::ERROR;
}

for (int i = 0; i < 2; ++i)
for (size_t i = 0; i < joint.state_interfaces.size(); ++i)
{
if (!(joint.state_interfaces[i].name == hardware_interface::HW_IF_POSITION ||
joint.state_interfaces[i].name == hardware_interface::HW_IF_VELOCITY))
joint.state_interfaces[i].name == hardware_interface::HW_IF_VELOCITY ||
joint.state_interfaces[i].name == hardware_interface::HW_IF_EFFORT ||
joint.state_interfaces[i].name == "object_detection_status"))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good reason to still consider 2 or 3 interfaces? isn't it always 4?

Comment on lines +361 to +371
if (first_run || current_speed != last_speed || current_force != last_force ||
current_position != last_position)
{
this->driver_->set_speed(current_speed);
this->driver_->set_force(current_force);
this->driver_->set_gripper_position(current_position);

last_speed = current_speed;
last_force = current_force;
last_position = current_position;
first_run = false;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the motivation for avoid redundant writes? It adds some complexity to the code, and I'm not sure if it has any effect.


hardware_interface::CallbackReturn
RobotiqGripperHardwareInterface::on_init(const hardware_interface::HardwareComponentInterfaceParams& params)
hardware_interface::CallbackReturn RobotiqGripperHardwareInterface::on_init(const hardware_interface::HardwareInfo& info)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HardwareInfo is deprecated, for me, at least on jazzy. So I think we should revert this.

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.

2 participants