Skip to content

Conversation

@BorgesJVT
Copy link
Contributor

Resolves #50

  • A diffbot folder was created similar to rrbot for URDF files;
  • A hardware in ros2_control_demo_hardware was created with position and velocity states and velocity command;
  • Launch file was added into ros2_control_demo_robot.

@codecov-io
Copy link

codecov-io commented Feb 22, 2021

Codecov Report

Merging #70 (b8c518e) into master (620b703) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master     #70     +/-   ##
========================================
  Coverage    0.00%   0.00%             
========================================
  Files          22       2     -20     
  Lines        1562     149   -1413     
========================================
+ Misses       1562     149   -1413     
Flag Coverage Δ
unittests 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...l_demo_hardware/src/rrbot_system_position_only.cpp
...l_demo_hardware/src/rrbot_system_position_only.cpp
...l_demo_hardware/src/rrbot_system_position_only.cpp
...l_demo_hardware/src/rrbot_system_position_only.cpp
...l_demo_hardware/src/rrbot_system_position_only.cpp
...l_demo_hardware/src/rrbot_system_position_only.cpp
...l_demo_hardware/src/rrbot_system_position_only.cpp
...l_demo_hardware/src/rrbot_system_position_only.cpp
...l_demo_hardware/src/rrbot_system_position_only.cpp
...l_demo_hardware/src/rrbot_system_position_only.cpp
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 620b703...b8c518e. Read the comment docs.

Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

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

Thanks for our contribution it looks very good. I have mostly nitpicks and a few clarification comments.

@BorgesJVT BorgesJVT requested a review from destogl February 23, 2021 11:04
Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

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

One step further.

#include "hardware_interface/types/hardware_interface_status_values.hpp"
#include "ros2_control_demo_hardware/visibility_control.h"

using hardware_interface::return_type;
Copy link
Member

Choose a reason for hiding this comment

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

Can you please remove this using and then adjust everywhere return_type? It's fairly simple with repalce-all function.


for (uint i = 0; i < hw_commands_.size(); i++) {
// Simulate DiffBot's movement
hw_states_[1] = hw_commands_[i] + (hw_states_[1] - hw_commands_[i]) / hw_slowdown_;
Copy link
Member

Choose a reason for hiding this comment

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

Does this slowdown make sense when using diff drive robot? I understand that your commands are velocities? you should here probably integrate to get position state and mabye create some artificial dynamics when velocity is changed. Does this make sense to you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I didn't understand the meaning of slowdown parameter. I was assuming it was a 'time constant' for rrbot dynamics.
Yes, my commands are velocities. I've changed my dynamics equation to get the velocity state.

I am aware that is necessary to integrate to get position state but as long as I understood, since the read function is reading from the hardware, the hardware would provide those infos (including the position state already integrated).
So, I integrated hw_states_[0] += hw_states_[1] / 2; with 'update_rate = 2' just to exhibit the data in radians. Otherwise, Should I calculate the current and last time inside diffbot_system? What do you recommend?

@BorgesJVT
Copy link
Contributor Author

Linters is putting a linelength=140 which is getting unrecognized.

@BorgesJVT BorgesJVT requested a review from destogl March 16, 2021 12:46
Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

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

looks good in general, a few comments that could reduce the overall content of this PR

@BorgesJVT BorgesJVT requested a review from bmagyar April 5, 2021 13:16
Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

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

Looks good to me

@BorgesJVT
Copy link
Contributor Author

Friendly ping @destogl

@destogl destogl force-pushed the demo_diff_drive_controller branch from 883c7c3 to c5badc8 Compare April 28, 2021 08:34
Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

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

I don't want to keep this open anymore. @BorgesJVT thank you for your patience. I will open a follow-up issue for the documenation. I will try to integrate this into #76.

@destogl destogl merged commit 1e14150 into ros-controls:master Apr 28, 2021
@Karsten1987
Copy link
Contributor

This PR is not working correctly I believe. The controller config is not being installed, which leads to an incorrect loading of parameters and the ros2_control node eventually failing due to a non-existing update_rate parameter.

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.

Create demo for diff drive controller

5 participants