Skip to content
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

For mobile robot with Isaac Sim (bug fixed version) #25

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

hijimasa
Copy link

[add] check velocity command exists to publish command
Solved the problem of commands not being published even if velocity was given, since only the difference in position was checked.

[change] separate position/velocity/effort command
This is the form of command expected by Isaac Sim.
Reference: https://docs.omniverse.nvidia.com/isaacsim/latest/ros2_tutorials/tutorial_ros2_manipulation.html#position-and-velocity-control-modes

[change] use mimic joint name to publish command
When the commands were separated, the joint state index was no longer available, so it was changed to search by name.

Edit: fixed bug about mimic joint only publish position command

@JafarAbdi JafarAbdi self-assigned this Sep 5, 2024
@@ -156,6 +160,15 @@ CallbackReturn TopicBasedSystem::on_init(const hardware_interface::HardwareInfo&
{
sum_wrapped_joint_states_ = true;
}
if (get_hardware_parameter("use_initial_states_as_initial_commands", "false") == "true")
Copy link
Collaborator

@JafarAbdi JafarAbdi Oct 8, 2024

Choose a reason for hiding this comment

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

Did you copy these changes from https://github.com/PickNikRobotics/topic_based_ros2_control/pull/24/files? Please use git cherry-pick to retain commit authorship attribution to the original author

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the review.
I didn't think I would get a response, so I had to copy other pull requests on my own.
I have never used git cherry-pick, but I will give it a try.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry for the late review, I'm hoping to get it merged today :)

Copy link
Author

Choose a reason for hiding this comment

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

I would like to merge the #24 pull request, is it merged into this repository? Or is there a procedure to merge forked repository?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll review it now, but I still don't understand the use case, can you give me an example where it's needed?

Copy link
Author

Choose a reason for hiding this comment

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

I misunderstood the cherry-pick in git. Does that mean I should delete the relevant part and re-commit?

Copy link
Author

Choose a reason for hiding this comment

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

I deleted the relevant part and re-committed.

@@ -89,6 +94,7 @@ class TopicBasedSystem : public hardware_interface::SystemInterface
/// The size of this vector is (standard_interfaces_.size() x nr_joints)
std::vector<std::vector<double>> joint_commands_;
std::vector<std::vector<double>> joint_states_;
std::vector<std::vector<double>> initial_joint_commands_;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Author

Choose a reason for hiding this comment

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

This is used to store the initial value of each joint; assigning to joint_commands_ will overwrite the value.

Copy link
Author

Choose a reason for hiding this comment

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

When using Isaac Sim and Move It 2, I have a different variable for joint_command because of the overwriting behavior when I set the initial value to joint_command. It seems that joint_command is overwritten with all zeros even when joint_command messages are not exchanged.

@@ -91,11 +92,12 @@ CallbackReturn TopicBasedSystem::on_init(const hardware_interface::HardwareInfo&
// Check the initial_value param is used
if (!interface.initial_value.empty())
{
joint_commands_[index][i] = std::stod(interface.initial_value);
initial_joint_commands_[index][i] = std::stod(interface.initial_value);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason to have a different variable for the initial ones? We should use command_interfaces rather than state_interfaces when getting the initial value

Copy link
Author

Choose a reason for hiding this comment

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

The following file appears to have initial values for state_interfaces. So I'm using state_interfaces.
Was this just because this file is out of date?
https://github.com/moveit/moveit_resources/blob/ros2/panda_moveit_config/config/panda.ros2_control.xacro

… with robot starting state"

This reverts commit 2b23e6c.
@JafarAbdi
Copy link
Collaborator

I added initial integration test to the repo #28, do you mind helping me writing tests for this PR as well? Writing tests that would fail without this PR

@hijimasa
Copy link
Author

hijimasa commented Oct 9, 2024

@JafarAbdi Do I just merge feature/integration_test and add the test?

@JafarAbdi
Copy link
Collaborator

@JafarAbdi Do I just merge feature/integration_test and add the test?

What do you think about creating a new branch on top of feature/integration_test then add them there?

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