I’m trying to add camera gimbal to the x500_mono_cam example model.
Running Gazebo Garden and ROS2 humble.
I modified the model to add a joint and a controller. In PX4-Autopilot/Tools/simulation/gz/models/x500_mono_cam/model.sdf
,
from the fixed joint,
<joint name="CameraJoint" type="fixed">
<parent>base_link</parent>
<child>mono_cam/base_link</child>
<pose relative_to="base_link">.12 .03 .242 0 0 0</pose>
</joint>
I changed it to revolute, controlled by a servo:
<joint name="CameraJoint" type="revolute">
<parent>base_link</parent>
<child>mono_cam/base_link</child>
<pose relative_to="base_link">.12 .03 .242 0 0 0</pose>
<axis>
<xyz>0 1 0</xyz>
<limit>
<lower>-1.57</lower>
<upper>1.57</upper>
</limit>
<dynamics>
<damping>1.000</damping>
</dynamics>
</axis>
</joint>
<plugin
filename="gz-sim-joint-position-controller-system" name="gz::sim::systems::JointPositionController">
<joint_name>servo_0</joint_name>
<sub_topic>servo_0</sub_topic>
<p_gain>10.0</p_gain>
</plugin>
I have also set Servo function to gimbal pitch in the frame config, in:
PX4-Autopilot/ROMFS/px4fmu_common/init.d-posix/airframes/4001_gz_x500
param set-default SIM_GZ_SV_FUNC1 421
When I run simulation, In “Actuators” tab in QGC I can see the gimbal pitch control slider, but when I move the slider camera does not move.
Am I missing something, or doing something wrong?