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

[DO_NOT_MERGE] Fix gz servo angle scale to match joint angles #21439

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jaeyoung-Lim
Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim commented Apr 6, 2023

Solved Problem

The gzbridge servo actuators have a scaling between 0 and 1000, which are then converted to a normalized joint angle between [-1. 1] radians which are quite arbitrary. Since the GzBridge controls the joint angles directly through ignition transport, it would be nice if we can have the joint angles configurable directly from the CA interface

Solution

This commit sets the scaling parameters for gz sim servos to match joint angle values directly

Note: This is not a functional PR yet

The issue is that the actuator output value type is uint16_t and therefore cannot have negative values.

Exception while parsing /home/jaeyoung/src/PX4-Autopilot/src/modules/simulation/gz_bridge/module.yaml:
Traceback (most recent call last):
  File "/home/jaeyoung/src/PX4-Autopilot/Tools/module_config/generate_params.py", line 379, in <module>
    raise e
  File "/home/jaeyoung/src/PX4-Autopilot/Tools/module_config/generate_params.py", line 375, in <module>
    actuator_output_params = get_actuator_output_params(yaml_config,
  File "/home/jaeyoung/src/PX4-Autopilot/Tools/module_config/generate_params.py", line 307, in get_actuator_output_params
    raise Exception('minimum value for {:} expected >= 0 (got {:})'.format(key, standard_params[key]['min']))
Exception: minimum value for disarmed expected >= 0 (got -1.0)

@bkueng @dagar Would you have any ideas on how to solve this? The interface seems to be only strictly built for an unsigned datatype

This commit sets the scaling parameters for gz sim servos to match joint angle values directly
@Jaeyoung-Lim Jaeyoung-Lim added the Sim: gazebo Gazebo simulator (gz) label Apr 6, 2023
@Jaeyoung-Lim Jaeyoung-Lim changed the title Fix gz servo angle scale to match joint angles [DO_NOT_MERGE] Fix gz servo angle scale to match joint angles Apr 6, 2023
@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-community-q-a-april-12-2023/31552/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sim: gazebo Gazebo simulator (gz)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants