aerostack2 / aerostack2.github.io

Documentation of the Aerostack2 Project
https://aerostack2.github.io/
MIT License
8 stars 6 forks source link

Control gimbal using as2_python_api.modules.point_gimbal_module.PointGimbalModule #67

Open OdedHorowits opened 3 days ago

OdedHorowits commented 3 days ago

Hello

I use Gazebo with Aerostack2. I added a gimbal with a camera as can be seen here:

{
    "world_name": "my_world",
    "drones": [
        {
            "model_type": "quadrotor_base",
            "model_name": "drone0",
            "xyz": [0.0, 0.0, 0.3],
            "rpy": [0, 0, 0],
            "flight_time": 60,
            "payload": [
                {
                    "model_type": "gimbal_position",
                    "model_name": "gb",
                    "payload":
                    {
                        "model_type": "rgbd_camera",
                        "model_name": "rgbd_camera"
                    }
                }
            ]
        }
    ]
}

What is the right way to control the gimbal?

Thank you

pariaspe commented 3 days ago

Hi @OdedHorowits , are you running PointGimbalBehaviour within your aerostack2 instance?

ros2 launch as2_behaviors_perception point_gimbal_behavior.launch.py
            namespace:=drone0
            use_sim_time:=true
            config_file:=sim_config/point_gimbal_behavior.yaml

Behavior configuration file should have the same gimbal name that used in the simulation description file:

/**:
  ros__parameters:
    gimbal_name: gb
    gimbal_frame_id: gb/_0/_1/_2
    gimbal_base_frame_id: gb
    gimbal_threshold: 0.1
    tf_timeout_threshold: 0.5