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

[Jazzy] How to set: position_proportional_gain #391

Closed
firesurfer opened this issue Aug 16, 2024 · 7 comments · Fixed by #393
Closed

[Jazzy] How to set: position_proportional_gain #391

firesurfer opened this issue Aug 16, 2024 · 7 comments · Fixed by #393

Comments

@firesurfer
Copy link

Hi I am looking for a way to set the position_proportional_gain parameter.

According to: #250 it should be possible to be set from a parameter file.
Unfortunately there seems to be no (or I can't find it) documentation on how to provide an additional configuration file for the gz_ros_control node from a launch file.

@firesurfer
Copy link
Author

A friendly push :)

@christophfroehlich
Copy link
Contributor

christophfroehlich commented Aug 22, 2024

I neither was able to pass ROS arguments to the gz_ros2_control node, I added a parser from the URDF in the linked PR.

@christophfroehlich
Copy link
Contributor

christophfroehlich commented Aug 22, 2024

I managed to pass ROS parameters: Just add this to the yaml file passed in the parameters

gz_ros_control:
  ros__parameters:
    position_proportional_gain: 0.5

be aware that the node is called gz_ros_control instead of gz_ros2_control ;)

@firesurfer
Copy link
Author

Sorry for the dumb question, but in a launch file. Which component do I need to pass that parameter file, is it the

	start_gazebo_cmd = IncludeLaunchDescription(
		PythonLaunchDescriptionSource(
			os.path.join(pkg_ros_gz_sim, 'launch', 'gz_sim.launch.py')),
		launch_arguments=[('gz_args', [' -r -v 4 empty.sdf']),])

As far as I am aware there is no example that shows how to pass a parameter file.

@christophfroehlich
Copy link
Contributor

I tried the same, and parameters should have wildcard namespace from the launch file -> it did not work.
I have no idea if this is possible, maybe the gz_sim.launch.py does not pass the parameters to gz.

@firesurfer
Copy link
Author

I managed to pass ROS parameters: Just add this to the yaml file passed in the parameters

gz_ros_control:
  ros__parameters:
    position_proportional_gain: 0.5

be aware that the node is called gz_ros_control instead of gz_ros2_control ;)

Then I don't understand your answer :D

Or is the PR you linked necessary for that to work ?

@christophfroehlich
Copy link
Contributor

No, the PR is for adding them as parameters in the URDF plugin tag.

Add gz_ros2_control namespace in the yaml file you load into the plugin, like this cart_controller.yaml

<gazebo>
  <plugin filename="libgz_ros2_control-system.so" name="gz_ros2_control::GazeboSimROS2ControlPlugin">
    <parameters>$(find gz_ros2_control_demos)/config/cart_controller.yaml</parameters>
  </plugin>
</gazebo>

They will be passed to the node of gz_ros_control.

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 a pull request may close this issue.

2 participants