Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Roslaunch vrpn_hover.launch occurs some errors #114

Open
lkyfly0765 opened this issue Dec 13, 2018 · 13 comments
Open

Roslaunch vrpn_hover.launch occurs some errors #114

lkyfly0765 opened this issue Dec 13, 2018 · 13 comments

Comments

@lkyfly0765
Copy link

lkyfly0765 commented Dec 13, 2018

Hi Whoenig:
We are going to do some research on crazyflies, and we have the Optitrack as the mocap system.
I following the instructions which provide in Flying Multiple UAVs Using ROS, and we are trying to let the single crazyflie to hover at a specified coordinate.

I have correctly configured the network on my laptop which runs the Ubuntu 14.05 caring the ROS system, and I have established the vrpn connections between the server computer which runs the Motive and my computer.The rigid body data can be attained by the ROS system.

Then I use eric@eric-ThinkPad-S2:~$ roslaunch crazyflie_demo hover_vrpn.launch the Rviz open as expect, and the crazyflie connected to the Crazyradio successfully. The I press the green button on the Xbox360 joystick, it occurs some errors, and the connection between Crazyflie and crazyradio lost.
What's wrong with it? How can I figure it out?

Thanks very much!

HERE IS THE LOG I COPIED FROM THE TERMINAL
eric@eric-ThinkPad-S2:~$ roslaunch crazyflie_demo hover_vrpn.launch
... logging to /home/eric/.ros/log/3d764118-feaf-11e8-a4ec-34f64bc13130/roslaunch-eric-ThinkPad-S2-18643.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

xacro: Traditional processing is deprecated. Switch to --inorder processing!
To check for compatibility of your document, use option --check-order.
For more infos, see http://wiki.ros.org/xacro#Processing_Order
xacro.py is deprecated; please use xacro instead
started roslaunch server http://eric-ThinkPad-S2:46519/

SUMMARY

PARAMETERS

  • /crazyflie/controller/PIDs/X/integratorMax: 0.1
  • /crazyflie/controller/PIDs/X/integratorMin: -0.1
  • /crazyflie/controller/PIDs/X/kd: 20.0
  • /crazyflie/controller/PIDs/X/ki: 2.0
  • /crazyflie/controller/PIDs/X/kp: 40.0
  • /crazyflie/controller/PIDs/X/maxOutput: 10.0
  • /crazyflie/controller/PIDs/X/minOutput: -10.0
  • /crazyflie/controller/PIDs/Y/integratorMax: 0.1
  • /crazyflie/controller/PIDs/Y/integratorMin: -0.1
  • /crazyflie/controller/PIDs/Y/kd: -20.0
  • /crazyflie/controller/PIDs/Y/ki: -2.0
  • /crazyflie/controller/PIDs/Y/kp: -40.0
  • /crazyflie/controller/PIDs/Y/maxOutput: 10.0
  • /crazyflie/controller/PIDs/Y/minOutput: -10.0
  • /crazyflie/controller/PIDs/Yaw/integratorMax: 0.0
  • /crazyflie/controller/PIDs/Yaw/integratorMin: 0.0
  • /crazyflie/controller/PIDs/Yaw/kd: -20.0
  • /crazyflie/controller/PIDs/Yaw/ki: 0.0
  • /crazyflie/controller/PIDs/Yaw/kp: -200.0
  • /crazyflie/controller/PIDs/Yaw/maxOutput: 200.0
  • /crazyflie/controller/PIDs/Yaw/minOutput: -200.0
  • /crazyflie/controller/PIDs/Z/integratorMax: 1000.0
  • /crazyflie/controller/PIDs/Z/integratorMin: -1000.0
  • /crazyflie/controller/PIDs/Z/kd: 6000.0
  • /crazyflie/controller/PIDs/Z/ki: 3500.0
  • /crazyflie/controller/PIDs/Z/kp: 5000.0
  • /crazyflie/controller/PIDs/Z/maxOutput: 60000.0
  • /crazyflie/controller/PIDs/Z/minOutput: 10000.0
  • /crazyflie/controller/frame: crazyflie
  • /crazyflie/controller/worldFrame: world
  • /crazyflie/crazyflie_add/enable_logging: False
  • /crazyflie/crazyflie_add/enable_logging_battery: True
  • /crazyflie/crazyflie_add/enable_logging_imu: True
  • /crazyflie/crazyflie_add/enable_logging_magnetic_field: True
  • /crazyflie/crazyflie_add/enable_logging_packets: True
  • /crazyflie/crazyflie_add/enable_logging_pressure: True
  • /crazyflie/crazyflie_add/enable_logging_temperature: True
  • /crazyflie/crazyflie_add/pitch_trim: 0
  • /crazyflie/crazyflie_add/roll_trim: 0
  • /crazyflie/crazyflie_add/tf_prefix: crazyflie
  • /crazyflie/crazyflie_add/uri: radio://0/99/2M
  • /crazyflie/crazyflie_add/use_ros_time: True
  • /crazyflie/joy/dev: /dev/input/js0
  • /crazyflie/joystick_controller/use_crazyflie_controller: True
  • /crazyflie/pose/name: goal
  • /crazyflie/pose/rate: 30
  • /crazyflie/pose/x: 0
  • /crazyflie/pose/y: 0
  • /crazyflie/pose/z: 0.5
  • /crazyflie/vrpn/child_frame_id: crazyflie
  • /crazyflie/vrpn/frame_id: /world
  • /crazyflie/vrpn/ip: 169.254.41.1
  • /crazyflie/vrpn/port: 3883
  • /robot_description: <?xml version="1....
  • /rosdistro: kinetic
  • /rosversion: 1.12.14

NODES
/crazyflie/
baselink_broadcaster (tf/static_transform_publisher)
controller (crazyflie_controller/crazyflie_controller)
crazyflie_add (crazyflie_driver/crazyflie_add)
joy (joy/joy_node)
joystick_controller (crazyflie_demo/controller.py)
pose (crazyflie_demo/publish_pose.py)
vrpn (ros_vrpn_client/ros_vrpn_client)
/
crazyflie_server (crazyflie_driver/crazyflie_server)
rviz (rviz/rviz)

ROS_MASTER_URI=http://localhost:11311

process[crazyflie_server-1]: started with pid [18663]
process[crazyflie/crazyflie_add-2]: started with pid [18664]
process[crazyflie/joy-3]: started with pid [18671]
process[crazyflie/joystick_controller-4]: started with pid [18683]
process[crazyflie/controller-5]: started with pid [18696]
process[crazyflie/pose-6]: started with pid [18708]
process[crazyflie/baselink_broadcaster-7]: started with pid [18715]
ERROR: cannot launch node of type [ros_vrpn_client/ros_vrpn_client]: ros_vrpn_client
ROS path [0]=/opt/ros/kinetic/share/ros
ROS path [1]=/home/eric/crazyflie_ws/src
ROS path [2]=/opt/ros/kinetic/share
process[rviz-9]: started with pid [18721]
[ INFO] [1544693916.676692342]: wait_for_service /add_crazyflie
[ INFO] [1544693916.682308135]: found /add_crazyflie
[ INFO] [1544693916.707744086]: Adding radio://0/99/2M as crazyflie with trim(0.000000, 0.000000). Logging: 1, Parameters: 0, Use ROS time: 1
[ INFO] [1544693916.787465893]: Opened joystick: /dev/input/js0. deadzone_: 0.050000.
[ WARN] [1544693916.820802795]: Received unrequested data for block: 0
[ WARN] [1544693916.822350875]: Received unrequested data for block: 0
[ WARN] [1544693916.823745598]: Received unrequested data for block: 0
[ WARN] [1544693916.826007066]: Received unrequested data for block: 0
[ WARN] [1544693916.829378873]: Received unrequested data for block: 0
[ WARN] [1544693916.830813201]: Received unrequested data for block: 0
[ WARN] [1544693916.832184832]: Received unrequested data for block: 0
[ WARN] [1544693916.833636089]: Received unrequested data for block: 0
[ WARN] [1544693916.835150110]: Received unrequested data for block: 1
[ WARN] [1544693916.836619250]: Received unrequested data for block: 0
[ WARN] [1544693916.838049663]: Received unrequested data for block: 0
[ WARN] [1544693916.840200255]: Received unrequested data for block: 0
[ WARN] [1544693916.841728012]: Received unrequested data for block: 0
[ WARN] [1544693916.843188294]: Received unrequested data for block: 0
[ WARN] [1544693916.844647729]: Received unrequested data for block: 0
[ WARN] [1544693916.846238137]: Received unrequested data for block: 0
[ WARN] [1544693916.847640199]: Received unrequested data for block: 0
[ WARN] [1544693916.849004644]: Received unrequested data for block: 0
[ WARN] [1544693916.850367412]: Received unrequested data for block: 0
[ WARN] [1544693916.851850372]: Received unrequested data for block: 1
[ WARN] [1544693916.854193381]: Received unrequested data for block: 0
[ WARN] [1544693916.855649713]: Received unrequested data for block: 0
[ WARN] [1544693916.857100051]: Received unrequested data for block: 0
[ WARN] [1544693916.858516980]: Received unrequested data for block: 0
[ WARN] [1544693916.859962727]: Received unrequested data for block: 0
[ WARN] [1544693916.861451174]: Received unrequested data for block: 0
[ WARN] [1544693916.862899770]: Received unrequested data for block: 0
[ WARN] [1544693916.864420015]: Received unrequested data for block: 0
[ WARN] [1544693916.865940701]: Received unrequested data for block: 0
[ WARN] [1544693916.867415151]: Received unrequested data for block: 1
[ WARN] [1544693916.868855552]: Received unrequested data for block: 0
[ WARN] [1544693916.870346789]: Received unrequested data for block: 0
[ WARN] [1544693916.871844061]: Received unrequested data for block: 0
[ WARN] [1544693916.873259971]: Received unrequested data for block: 0
[ WARN] [1544693916.874836076]: Received unrequested data for block: 0
[ WARN] [1544693916.876564620]: Received unrequested data for block: 0
[ WARN] [1544693916.878132221]: Received unrequested data for block: 0
[ WARN] [1544693916.879506459]: Received unrequested data for block: 0
[ WARN] [1544693916.880893125]: Received unrequested data for block: 0
[ WARN] [1544693916.882299534]: Received unrequested data for block: 0
[ WARN] [1544693916.883705146]: Received unrequested data for block: 1
[ WARN] [1544693916.885132496]: Received unrequested data for block: 0
[ WARN] [1544693916.886479128]: Received unrequested data for block: 0
[ WARN] [1544693916.887875758]: Received unrequested data for block: 0
[ WARN] [1544693916.889314749]: Received unrequested data for block: 0
[ WARN] [1544693916.890733090]: Received unrequested data for block: 0
[ WARN] [1544693916.892180609]: Received unrequested data for block: 0
[ WARN] [1544693916.893665615]: Received unrequested data for block: 0
[ WARN] [1544693916.895126503]: Received unrequested data for block: 0
[ WARN] [1544693916.896664663]: Received unrequested data for block: 0
[ WARN] [1544693916.898109100]: Received unrequested data for block: 0
[ WARN] [1544693916.899634969]: Received unrequested data for block: 1
[ WARN] [1544693916.901091987]: Received unrequested data for block: 0
[ WARN] [1544693916.902522150]: Received unrequested data for block: 0
[ WARN] [1544693916.903947394]: Received unrequested data for block: 0
[ WARN] [1544693916.905336536]: Received unrequested data for block: 0
[ WARN] [1544693916.906822018]: Received unrequested data for block: 0
[ WARN] [1544693916.910211220]: Received unrequested data for block: 0
[ WARN] [1544693916.912117693]: Received unrequested data for block: 0
[ WARN] [1544693916.913842304]: Received unrequested data for block: 0
[ WARN] [1544693916.915498667]: Received unrequested data for block: 0
[ INFO] [1544693916.916537921]: Requesting parameters...
[crazyflie/crazyflie_add-2] process has finished cleanly
log file: /home/eric/.ros/log/3d764118-feaf-11e8-a4ec-34f64bc13130/crazyflie-crazyflie_add-2*.log
[ INFO] [1544693919.126246717]: Found variables in cache.
[ INFO] [1544693919.392705502]: Requesting memories...
[ INFO] [1544693919.401282020]: Memories: 2
[ INFO] [1544693919.422345215]: Ready...
[ INFO] [1544693919.422402363]: Elapsed: 2.603216 s
[INFO] [1544693919.668016]: found update_params service
[INFO] [1544693919.668775]: waiting for emergency service
[INFO] [1544693919.671867]: found emergency service
[INFO] [1544693919.672730]: waiting for land service
[INFO] [1544693919.677472]: found land service
[INFO] [1544693919.678094]: waiting for takeoff service
[INFO] [1544693919.680637]: found takeoff service
[ INFO] [1544693949.963402421]: Takeoff requested!
[ERROR] [1544693949.963801181]: Exception thrown while processing service call: Could not find a connection between 'world' and 'crazyflie' because they are not part of the same tree.Tf has two or more unconnected trees.
[ERROR] [1544693949.966671]: bad callback: <bound method Controller._joyChanged of <main.Controller instance at 0x7f01a26333f8>>
Traceback (most recent call last):
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 750, in _invoke_callback
cb(msg)
File "/home/eric/crazyflie_ws/src/crazyflie_ros/crazyflie_demo/scripts/controller.py", line 46, in _joyChanged
self._takeoff()
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 435, in call
return self.call(*args, **kwds)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 515, in call
responses = transport.receive_once()
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 727, in receive_once
p.read_messages(b, msg_queue, sock)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 353, in read_messages
self._read_ok_byte(b, sock)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 336, in _read_ok_byte
raise ServiceException("service [%s] responded with an error: %s"%(self.resolved_name, str))
ServiceException: service [/crazyflie/takeoff] responded with an error: Could not find a connection between 'world' and 'crazyflie' because they are not part of the same tree.Tf has two or more unconnected trees.

terminate called after throwing an instance of 'tf2::ConnectivityException'
what(): Could not find a connection between 'world' and 'crazyflie' because they are not part of the same tree.Tf has two or more unconnected trees.
[crazyflie/controller-5] process has died [pid 18696, exit code -6, cmd /home/eric/crazyflie_ws/devel/lib/crazyflie_controller/crazyflie_controller __name:=controller __log:=/home/eric/.ros/log/3d764118-feaf-11e8-a4ec-34f64bc13130/crazyflie-controller-5.log].
log file: /home/eric/.ros/log/3d764118-feaf-11e8-a4ec-34f64bc13130/crazyflie-controller-5*.log

@whoenig
Copy link
Owner

whoenig commented Dec 14, 2018

The error message

Could not find a connection between 'world' and 'crazyflie' because they are not part of the same tree.Tf has two or more unconnected trees.

indicates that there is an issue with your transformations. You can visualize the transformations using rosrun tf view_frames && evinces frames.pdf. Is there a world frame and a crazyflie frame that are connected by an arrow?

@lkyfly0765
Copy link
Author

I have used the command you provided and I got a pdf file which contains a arrow connect the world and cf1.

@whoenig
Copy link
Owner

whoenig commented Dec 18, 2018

You add the crazyflie using the name "crazyflie", so your rigid body should be named "crazyflie" and not "cf1".

@lkyfly0765
Copy link
Author

lkyfly0765 commented Dec 23, 2018

I have figure it out. The key is that I need to change the channel and the bandwidth in all related launchfiles.
Another problem I am facing it that when the crazyflie take off using the hover-vrpn.launch file, it is not stable. In the launch file, the hover point is set to (0,0,0.5), but actually the crazyflie float at about (0,0,0.3) to (0,0,1). It’s altitude is not stable. What’s wrong with it? Does this problem relate to the PID parameters?

@whoenig
Copy link
Owner

whoenig commented Jan 4, 2019

The crazyflie now has an onboard position controller that can follow waypoints or trajectories at a much higher accuracy than the off-board controller you are using now. There is no documentation in crazylie_ros for that yet (although it is described in some of the older issues), but you can check out the crazyswarm project: https://crazyswarm.readthedocs.io (which also works if you are interested in just using a few CFs).

@shmpwk
Copy link

shmpwk commented Mar 20, 2019

Hi, @lkyfly0765 @whoenig

I have a same error.

Could not find a connection between 'world' and 'crazyflie' because they are not part of the same tree.Tf has two or more unconnected trees.

How to change program like

to change the channel and the bandwidth in all related launchfiles.

Which file should I change or should I make another file?

I read #85 but I couldn't solve the problem yet.

@lkyfly0765
Copy link
Author

lkyfly0765 commented Mar 20, 2019 via email

@shmpwk
Copy link

shmpwk commented Mar 20, 2019

Thank you for your quick response, Eric.
I'll try it tomorrow.

Best regards, Shumpei

@lkyfly0765
Copy link
Author

lkyfly0765 commented Mar 20, 2019 via email

@shmpwk
Copy link

shmpwk commented Mar 20, 2019

Hi, Eric,

I changed as you said, but cannot connect 'world' and 'crazyflie1'.
Looking at tf view_frame, there are still two 'crazyflie1'.
Did you change other program?
My launch file is this.

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

  <arg name="uri" default="radio://0/80/250K" />
  <arg name="frame" default="crazyflie1" />
  <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">
  </include>

  <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="False" />
    </include>

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

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

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

    <node name="pose" pkg="crazyflie_demo" type="publish_pose.py" 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>
  <!-- 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)" />
    </node>

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

  

  </group>


  <!-- run rviz -->
  <param name="robot_description" command="$(find xacro)/xacro.py $(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" />

</launch>

@lkyfly0765
Copy link
Author

lkyfly0765 commented Mar 21, 2019 via email

@lkyfly0765
Copy link
Author

lkyfly0765 commented Mar 21, 2019 via email

@shmpwk
Copy link

shmpwk commented Mar 21, 2019

Thank you very much for super thorough explaining!

I chacked 1 by 1, and found all things correct. So, the cause of the problem is not what you told me.

Actually, I use Cortex as the motion capture system. It can also use VRPN connection.
So now I'll chack its program carefully again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants