From 331a4ece9643407e6dc3cc03c1b2c72de3e633bf Mon Sep 17 00:00:00 2001 From: knmcguire Date: Thu, 30 May 2024 10:58:23 +0200 Subject: [PATCH 1/8] add text about motion capture --- crazyflie/config/motion_capture.yaml | 4 ++-- docs2/usage.rst | 36 +++++++++++++++++++++------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/crazyflie/config/motion_capture.yaml b/crazyflie/config/motion_capture.yaml index c9324ea41..ea20e4b44 100644 --- a/crazyflie/config/motion_capture.yaml +++ b/crazyflie/config/motion_capture.yaml @@ -1,10 +1,10 @@ /motion_capture_tracking: ros__parameters: + # one of "optitrack", "optitrack_closed_source", "vicon", "qualisys", "nokov", "vrpn", "motionanalysis" type: "optitrack" + # Specify the hostname or IP of the computer running the motion capture software hostname: "141.23.110.143" - mode: "libobjecttracker" # one of motionCapture,libRigidBodyTracker - topics: poses: qos: diff --git a/docs2/usage.rst b/docs2/usage.rst index 74caf33d9..e48acd263 100644 --- a/docs2/usage.rst +++ b/docs2/usage.rst @@ -12,8 +12,8 @@ Usage .. warning:: - If you work in a shared network (lab, classroom) or similar, you might want to avoid - controlling other robots. This is in particular true for simulation. In this case, + If you work in a shared network (lab, classroom) or similar, you might want to avoid + controlling other robots. This is in particular true for simulation. In this case, you can use .. code-block:: bash @@ -29,7 +29,7 @@ Usage Configuration ------------- -All configuration files are in crazyflie/config. +All configuration files are in crazyflie/config. * crazyflies.yaml : setting up everything related to the robots. * server.yaml : setting up everything related to the server. @@ -40,7 +40,7 @@ crazyflies.yaml ~~~~~~~~~~~~~~~ Each crazyflie should have an unique URI which can `be changed in Bitcraze's CFclient `_. -They can also be enabled in case you don't want the server to connect with it. +They can also be enabled in case you don't want the server to connect with it. .. code-block:: yaml @@ -109,13 +109,33 @@ The yaml file also contain an 'all' field, in case you have parameters or loggin estimator: 2 # 1: complementary, 2: kalman controller: 2 # 1: PID, 2: mellinger -The above also contains an example of the firmware_logging field, where default topics can be enabled or custom topics based on the `existing log toc of the crazyflie `_. -Moreover, it also contains the firmware_params field, where parameters can be set at startup. -Also see the `parameter list of the crazyflie `_ for that. +The above also contains an example of the firmware_logging field, where default topics can be enabled or custom topics based on the `existing log toc of the crazyflie `_. +Moreover, it also contains the firmware_params field, where parameters can be set at startup. +Also see the `parameter list of the crazyflie `_ for that. Mind that you can also place the firmware_params and firmware_logging fields per crazyflie in 'robots' or the 'robot_types' field. -The server node will upon initialization, first look at the params/logs from the individual crazyflie's settings, then the robot_types, and then anything in 'all' which has lowest priority. +The server node will upon initialization, first look at the params/logs from the individual crazyflie's settings, then the robot_types, and then anything in 'all' which has lowest priority. + +Positioning +----------- + +Motion capture +~~~~~~~~~~~~~~ + +If you have a motion capture system, you can input the specifics in the motion_capture.yaml file. + +.. code-block:: yaml + /motion_capture_tracking: + ros__parameters: + type: "optitrack" + hostname: "optitrackPC" + +'Type' can replaced by "optitrack", "vicon", "qualisys" or any of the other supported motion capture systems of the `motion capture tracking package `_. +'hostname' is the hostname of the computer running the motion capture software which can either be the PC name or the IP. + + + Simulation From 76248e96866eb4212572e22ed3fd2f4381d04e24 Mon Sep 17 00:00:00 2001 From: knmcguire Date: Thu, 30 May 2024 17:10:58 +0200 Subject: [PATCH 2/8] add text about other positoing systems --- docs2/usage.rst | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/docs2/usage.rst b/docs2/usage.rst index e48acd263..edc065909 100644 --- a/docs2/usage.rst +++ b/docs2/usage.rst @@ -120,6 +120,10 @@ The server node will upon initialization, first look at the params/logs from the Positioning ----------- +The Crazyflie can be positioned in different ways, including motion capture and onboard positioning. +This blogpost provides a good overview of the different positioning systems if you are unsure about which one you are using: `Positioning System Overview + `_. + Motion capture ~~~~~~~~~~~~~~ @@ -134,8 +138,48 @@ If you have a motion capture system, you can input the specifics in the motion_c 'Type' can replaced by "optitrack", "vicon", "qualisys" or any of the other supported motion capture systems of the `motion capture tracking package `_. 'hostname' is the hostname of the computer running the motion capture software which can either be the PC name or the IP. +Also make sure that in crazyflies.yaml, the motion_capture field is enabled for the specific robot type, or that the crazyflie is of a type that supports motion capture. + +.. code-block:: yaml + robot_types: + cf21: + motion_capture: + enabled: true + +For more indepth information about the motion capture tracking package, see the `documentation `_. + +Onboard positioning +~~~~~~~~~~~~~~~~~~~ + +The Crazyflie also supports several alternative positioning systems that provide direct onboard position or pose estimation. +In this case you do not need to receive positioning from an external system like with MoCap. + +Instructions per positioing system.: +* The `Loco positioning system `_ - Follow Bitcraze's tutorial `here `. +* The `Lighthouse positioning system `_ - Follow Bitcraze's tutorial `here `. + * Make sure to review the system management for saving and loading a system config, such that you don't have to redo the basestation geometry estimation for each crazyflie. +* The `Flow deck `_ - Follow Bitcraze's tutorial `here `. + * Note that the flow deck provides an relative positoing estimate and might conflict when you are flying with crazyswarm2 if you are flying with absolute coordinates instead of relative ones. +Also in this case, make sure that motion_capture is disabled in the crazyflies.yaml file: + +.. code-block:: yaml + robot_types: + cf21: + motion_capture: + enabled: false + +Also it is a good idea to turn on pose estimation logging such that you are able to see the poses and transforms of the Crazyflie updated in real life in rviz or the Swarm management gui. + +.. code-block:: yaml + all: + firmware_logging: + enabled: true + default_topics: + # remove to disable default topic + pose: + frequency: 10 # Hz Simulation From feefb6030693402dceb6699d226fc7024a730921 Mon Sep 17 00:00:00 2001 From: knmcguire Date: Thu, 30 May 2024 17:19:22 +0200 Subject: [PATCH 3/8] fix issue --- docs2/usage.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs2/usage.rst b/docs2/usage.rst index edc065909..5fdb08ec7 100644 --- a/docs2/usage.rst +++ b/docs2/usage.rst @@ -121,8 +121,7 @@ Positioning ----------- The Crazyflie can be positioned in different ways, including motion capture and onboard positioning. -This blogpost provides a good overview of the different positioning systems if you are unsure about which one you are using: `Positioning System Overview - `_. +This blogpost provides a good overview of the different positioning systems if you are unsure about which one you are using: `Positioning System Overview `_. Motion capture ~~~~~~~~~~~~~~ From 497a3535fa5fb0bd0faff959418b6046a9a7a948 Mon Sep 17 00:00:00 2001 From: knmcguire Date: Thu, 30 May 2024 17:23:46 +0200 Subject: [PATCH 4/8] fix block issue --- docs2/usage.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs2/usage.rst b/docs2/usage.rst index 5fdb08ec7..744998229 100644 --- a/docs2/usage.rst +++ b/docs2/usage.rst @@ -129,6 +129,7 @@ Motion capture If you have a motion capture system, you can input the specifics in the motion_capture.yaml file. .. code-block:: yaml + /motion_capture_tracking: ros__parameters: type: "optitrack" @@ -140,6 +141,7 @@ If you have a motion capture system, you can input the specifics in the motion_c Also make sure that in crazyflies.yaml, the motion_capture field is enabled for the specific robot type, or that the crazyflie is of a type that supports motion capture. .. code-block:: yaml + robot_types: cf21: motion_capture: @@ -163,6 +165,7 @@ Instructions per positioing system.: Also in this case, make sure that motion_capture is disabled in the crazyflies.yaml file: .. code-block:: yaml + robot_types: cf21: motion_capture: @@ -171,6 +174,7 @@ Also in this case, make sure that motion_capture is disabled in the crazyflies.y Also it is a good idea to turn on pose estimation logging such that you are able to see the poses and transforms of the Crazyflie updated in real life in rviz or the Swarm management gui. .. code-block:: yaml + all: firmware_logging: From 100976a100b7aeaaea918e52c2fb104e9a1c5ad7 Mon Sep 17 00:00:00 2001 From: knmcguire Date: Thu, 30 May 2024 17:28:39 +0200 Subject: [PATCH 5/8] indentation issue --- docs2/usage.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs2/usage.rst b/docs2/usage.rst index 744998229..af242c8a0 100644 --- a/docs2/usage.rst +++ b/docs2/usage.rst @@ -157,10 +157,8 @@ In this case you do not need to receive positioning from an external system like Instructions per positioing system.: * The `Loco positioning system `_ - Follow Bitcraze's tutorial `here `. -* The `Lighthouse positioning system `_ - Follow Bitcraze's tutorial `here `. - * Make sure to review the system management for saving and loading a system config, such that you don't have to redo the basestation geometry estimation for each crazyflie. -* The `Flow deck `_ - Follow Bitcraze's tutorial `here `. - * Note that the flow deck provides an relative positoing estimate and might conflict when you are flying with crazyswarm2 if you are flying with absolute coordinates instead of relative ones. +* The `Lighthouse positioning system `_ - Follow Bitcraze's tutorial `here `. Make sure to review the system management for saving and loading a system config, such that you don't have to redo the basestation geometry estimation for each crazyflie. +* The `Flow deck `_ - Follow Bitcraze's tutorial `here `. Note that the flow deck provides an relative positoing estimate and might conflict when you are flying with crazyswarm2 if you are flying with absolute coordinates instead of relative ones. Also in this case, make sure that motion_capture is disabled in the crazyflies.yaml file: From 21cc171c244aefeca567128f3aafdd4700785ee5 Mon Sep 17 00:00:00 2001 From: Kimberly McGuire Date: Fri, 31 May 2024 08:58:44 +0200 Subject: [PATCH 6/8] Update docs2/usage.rst --- docs2/usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs2/usage.rst b/docs2/usage.rst index af242c8a0..6321485f0 100644 --- a/docs2/usage.rst +++ b/docs2/usage.rst @@ -155,7 +155,7 @@ Onboard positioning The Crazyflie also supports several alternative positioning systems that provide direct onboard position or pose estimation. In this case you do not need to receive positioning from an external system like with MoCap. -Instructions per positioing system.: +Instructions per positioning system.: * The `Loco positioning system `_ - Follow Bitcraze's tutorial `here `. * The `Lighthouse positioning system `_ - Follow Bitcraze's tutorial `here `. Make sure to review the system management for saving and loading a system config, such that you don't have to redo the basestation geometry estimation for each crazyflie. * The `Flow deck `_ - Follow Bitcraze's tutorial `here `. Note that the flow deck provides an relative positoing estimate and might conflict when you are flying with crazyswarm2 if you are flying with absolute coordinates instead of relative ones. From 33fae442ad0b6490ef6eb25dcaad23aab44706ec Mon Sep 17 00:00:00 2001 From: knmcguire Date: Fri, 31 May 2024 09:03:46 +0200 Subject: [PATCH 7/8] fix indention --- docs2/usage.rst | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/docs2/usage.rst b/docs2/usage.rst index 6321485f0..fd54ef49a 100644 --- a/docs2/usage.rst +++ b/docs2/usage.rst @@ -143,9 +143,9 @@ Also make sure that in crazyflies.yaml, the motion_capture field is enabled for .. code-block:: yaml robot_types: - cf21: - motion_capture: - enabled: true + cf21: + motion_capture: + enabled: true For more indepth information about the motion capture tracking package, see the `documentation `_. @@ -165,24 +165,20 @@ Also in this case, make sure that motion_capture is disabled in the crazyflies.y .. code-block:: yaml robot_types: - cf21: - motion_capture: - enabled: false + cf21: + motion_capture: + enabled: false Also it is a good idea to turn on pose estimation logging such that you are able to see the poses and transforms of the Crazyflie updated in real life in rviz or the Swarm management gui. .. code-block:: yaml - all: - firmware_logging: enabled: true default_topics: - # remove to disable default topic - pose: + pose: frequency: 10 # Hz - Simulation ---------- From 796c5b55acc45eecdbbb8253dc857a54df49c92b Mon Sep 17 00:00:00 2001 From: knmcguire Date: Fri, 31 May 2024 09:16:54 +0200 Subject: [PATCH 8/8] add mocap launch variable --- crazyflie/launch/launch.py | 5 +++-- docs2/usage.rst | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crazyflie/launch/launch.py b/crazyflie/launch/launch.py index be2ed1339..734824b3c 100644 --- a/crazyflie/launch/launch.py +++ b/crazyflie/launch/launch.py @@ -5,7 +5,7 @@ from launch.actions import DeclareLaunchArgument from launch_ros.actions import Node from launch.conditions import LaunchConfigurationEquals -from launch.conditions import LaunchConfigurationNotEquals +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression @@ -83,13 +83,14 @@ def generate_launch_description(): DeclareLaunchArgument('debug', default_value='False'), DeclareLaunchArgument('rviz', default_value='False'), DeclareLaunchArgument('gui', default_value='True'), + DeclareLaunchArgument('mocap', default_value='True'), DeclareLaunchArgument('server_yaml_file', default_value=''), DeclareLaunchArgument('teleop_yaml_file', default_value=''), DeclareLaunchArgument('mocap_yaml_file', default_value=''), Node( package='motion_capture_tracking', executable='motion_capture_tracking_node', - condition=LaunchConfigurationNotEquals('backend','sim'), + condition=IfCondition(PythonExpression(["'", LaunchConfiguration('backend'), "' != 'sim' and '", LaunchConfiguration('mocap'), "' == 'True'"])), name='motion_capture_tracking', output='screen', parameters= [PythonExpression(["'tmp_motion_capture.yaml' if '", LaunchConfiguration('mocap_yaml_file'), "' == '' else '", LaunchConfiguration('mocap_yaml_file'), "'"])], diff --git a/docs2/usage.rst b/docs2/usage.rst index fd54ef49a..9f8270b32 100644 --- a/docs2/usage.rst +++ b/docs2/usage.rst @@ -179,6 +179,9 @@ Also it is a good idea to turn on pose estimation logging such that you are able pose: frequency: 10 # Hz + +Moreover, be aware that the motion capture node is enabled in the launch file by default, which can be turned off by adding 'mocap:=False' to the launch command. + Simulation ----------