Open zychaoqun opened 7 years ago
I believe you need to compile the mav_msgs package first.
See http://wiki.ros.org/ROS/Tutorials/CreatingMsgAndSrv for information about ROS messages. Specifically, it states
"Any .msg file in the msg directory will generate code for use in all supported languages. The C++ message header file will be generated in ~/catkin_ws/devel/include/beginner_tutorials/."
Therefore, once you build the mav_msgs package, the CommandMotorSpeed.h file should be generated in the ~/catkin_ws/devel/... directory.
Let me know if that helps. I can try to locate the CommandMotorSpeed.h on my test machine if you need the exact file path.
Thanks for your response. I can compile the file successfully. Thanks for your help. In addition ,there are two editions of mav_comm package in github, which is a little different.
Can I just use the command below with the instructions on your webpage to get the result ?
roslaunch ROS_quadrotor_simulator quad_3nav.launch
I can launch the gazebo and rviz successfully. But I can't interact with the model in rviz now. When I set the fixed frame to world, it seems there is a problem , but it works when I set the fixed frame to base_link. And also I don't know what I should do next to help the quadrotor fly autonomously. What's more, there is no quadrotor model in gazebo. So many thanks for your help!
Yes you should be able to run that command to start the 3D navigation simulation. I added a detailed readme to this package so see if those instructions help.
If you still have issues with the tf, I can post the tr graph. Also, you can download the models from the rotors simulator package described in the readme. The readme also describe the different flight modes that can be enabled by pressing certain buttons on the controller. This is defined in the quad_joystick_interface package.
So many thanks!I will follow!
Many thanks for your help! I follow the instructions in github. While there are some problems. The first is the compile error. I found that there are two editions of "mav_comm" package, the one (https://github.com/ethz-asl/mav_comm) works for rotors_simulate, while the other one (https://github.com/PX4/mav_comm) works for our package. While neither of them works for both. This is the modified edition of these two package, I have compiled successfully with this modified package(https://github.com/zychaoqun/mav_comm_beta ). Hopefully it would help.
However, when I launched quad_3nav.launch, I can see the quadrotor with interactive markers in rviz, while when I add a pointcloud2 message, there is an error:
For frame [quad/camera__optical_center_link]: No transform to fixed frame [world]. TF error: [Could not find a connection between 'world' and 'quad/camera__optical_center_link' because they are not part of the same tree.Tf has two or more unconnected trees.]
I check the tf frame and found that there is no connection between frame 'world' and 'baselink', and I can not see the octomap in rviz. I follow the moveit! tutorials and set the fixed frame to 'world'. Any suggestions to solve this problem?
Thanks for checking on the mav_comm package. Which "rotors_simulate" package were you referring to the current mav_comm package doesn't support?
I ran the quad_3dnav.launch file and got the TF tree at this link: https://s3-us-west-2.amazonaws.com/selbystorage/wp-content/uploads/2016/09/quad3dnav_tf.pdf
the kit_c_base.xacro file declares the parent_link variable to be base_link. Then in the component_snippets-xacro file, the camera_macro has the link_name to be namespace/camera__link with a namespace/camera_joint that has a link name of namespace/camera_optical_center_link.
That should be the linkages up to the base_link. I can paste the full text output when I run the launch command as well if that helps.
Thanks for your reply , the "rotors_simulate" package means the "rotors_simulator" pakage bt eth (https://github.com/ethz-asl/rotors_simulator).
Still I can not get the correct TF tree as you indicate above.I have "world " to "odometry" in tf tree but there is no link from 'world' to 'base_link'. My file is just copy yours https://github.com/wilselby/ROS_quadrotor_simulator/blob/master/quad_description/urdf/kit_c_base.xacro, would you please tell me which code is mean to achieve this transformation?
The purpose of the world joint mechanism is to allow you to position your robot's base in the world. This joint isn't contained in the URDF as it's not really an aspect of your robot, but rather a product of whatever odometric system you are using. The /odom (to /base_link) frame is broadcast by an odometry producing node.
Specifically, as you noted, this is handled in the kit_c_base.xacro file
<xacro:odometry_plugin_macro namespace="${namespace}/ground_truth" odometry_sensor_suffix="gt" parent_link="base_link" pose_topic="pose" pose_with_covariance_topic="pose_with_covariance" position_topic="position" transform_topic="transform" odometry_topic="odometry" parent_frame_id="world"
which is then input into the odometry_plugin_macro in component_snippets.xacro. You can see the parent_frame_id set to world and the parent_link set to base_link. Can you try recopying both those files to double check?
If that doesn't work, can you try running: roslaunch quad_gazebo quad_joystick_empty_world.launch
and see if that works? That is a very basic simulation of the quadrotor in an empty world. When I run it, I just have a TF tree of world connected to base_link. If you look at the node graph, you should have the /gazebo node publishing a /tf topic.
Here are some other potential RViz settings you could check if neither of the above work. Do you see any errors in the RViz menu?
Global Options->Fixed Frame: "world"
Grid->Reference Frame: "
I have tried recopying the file but still there is no link between /odom and /base_link. By the way ,should I run some odometry or slam node if I want to do 3D mapping? I always thought that I can achieve 3D mapping as you depict singly by running the quad_3dnav node.Is it right? Or I need additional odometry node or GPS to provide the localization of the quadrotor? Many thanks!
Did you try all of the different options above including replacing the components.xacro file?
The GPS odometry node is automatically run with the base quadrotor. For 3D nav, that sensor is used for localization and the Kinect is used to create the octomap for obstacle avoidance and path planning. The quad_3dnav.launch file launches the move_group.launch which runs the quad_moveit_sensor_manager.launch file which loads the ensors_kinect.yaml config file that contains the kinect sensor topic.
The 2D navigation simulation does so localization if you would like to see an example. It uses the AMCL package for localization in a known map.
sorry for trouble, I tried but still can not get the tf from world to base_link, should I turn GPS mode on then I can get this tf? I didn't have xbox joystick so this is the last thing I didn't do.
No trouble at all, sorry it's not working for you. I don't think enabling GPS mode will have a difference.
Can you run roslaunch quad_gazebo quad_joystick_empty_world.launch and verify the TF map still has the same issue?
when I trying to compile the 3d_nav package ,I got the error
fatal error: mav_msgs/CommandMotorSpeed.h: No such file or directory
include <mav_msgs/CommandMotorSpeed.h>
And I checked the mav_msgs package, I just cannot find the commandMotorsSpeed.h file in that package. I install the mav_msgs using the package https://github.com/ethz-asl/mav_comm Apparently there is no such kind of .h file in that package,what should I do ?