Page 1 of 1

Question with fly with vrpn system

Posted: Tue Jan 12, 2021 12:24 pm
by gpczygpczy
Hello,everyone! I am a recruit to crazyflie.I fly the crazyflie under the motion capture,it neither vicon nor optical tracker, but it uses the vrpn agreemnet,can I use the hover_vrpn.launch file to let the crazyflie hover?

Re: Question with fly with vrpn system

Posted: Wed Jan 13, 2021 10:01 am
by whoenig
Yes, that is possible. You can also you use the Crazyswarm with VRPN.

Re: Question with fly with vrpn system

Posted: Sat Jan 16, 2021 6:05 am
by gpczygpczy
Thank you for your replay!
After several attempt(I'm following the Hoenig_Springer_ROS2017.pdf),when I press the XBbox360 controller to take off,it can start and always straight up but can't hover.I can't find the problem :( :( .
My launch file is like this

Code: Select all

<?xml version="1.0"?>
  <arg name="joy_dev" default="/dev/input/js0" />
  <arg name="ip" default="" />
  <arg name="port" default="3883" />

  <arg name="uri" default="radio://0/80/2M/E7E7E7E705" />
  <arg name="frame" default="cf1" />
  <arg name="x" default="0" />                                
  <arg name="y" default="0" />
  <arg name="z" default="0.5" />                            

  <include file="$(find crazyflie_driver)/launch/crazyflie_server.launch">

  <group ns="crazyflie">
    <include file="$(find crazyflie_driver)/launch/crazyflie_add.launch">
      <arg name="uri" value="$(arg uri)" />
      <arg name="tf_prefix" value="crazyflie" />
      <arg name="enable_logging" value="True" />

    <node name="joy" pkg="joy" type="joy_node" output="screen">
      <param name="dev" value="$(arg joy_dev)" />

    <include file="$(find crazyflie_demo)/launch/xbox360.launch">

    <node name="joystick_controller" pkg="crazyflie_demo" type="" output="screen" >         
      <param name="use_crazyflie_controller" value="True" />

    <include file="$(find crazyflie_controller)/launch/crazyflie2.launch">
      <arg name="frame" value="$(arg frame)" />

    <node name="pose" pkg="crazyflie_demo" type="" output="screen">
      <param name="name" value="goal" />
      <param name="rate" value="30" />  
      <param name="x" value="$(arg x)" />
      <param name="y" value="$(arg y)" />
      <param name="z" value="$(arg z)" />           

    <node pkg="tf" type="static_transform_publisher" name="baselink_broadcaster" args="0 0 0 0 0 0 1 $(arg frame) /crazyflie/base_link 100" />

    <!-- run vrpn client -->
    <node pkg="vrpn_client_ros" name="vrpn" output="screen" type="vrpn_client_node" required="true">
      <param name="ip" value="$(arg ip)" />
      <param name="port" value="$(arg port)" />
      <param name="frame_id" value="/world" />
      <param name="child_frame_id" value="$(arg frame)" />

  <!-- run rviz -->
  <param name="robot_description" command="$(find xacro)/ $(find crazyflie_description)/urdf/crazyflie.urdf.xacro" />
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find crazyflie_demo)/launch/crazyflie_pos.rviz" required="true" />

When I run the launch file,input in the terminal is "roslaunch crazyflie_demo hover_vrpn.launch frame:= MCServer ",MCServer is the name of my motion capture.

Re: Question with fly with vrpn system

Posted: Mon Jan 18, 2021 9:32 pm
by whoenig
A frequent problem is that your VRPN coordinate system does not match the ROS coordinate system. Without flying, move your Crazyflie around while visualizing (e.g., using `rostopic echo` or `rviz`) the current coordinate system. Make sure that positive-z is indeed the upwards motion.