Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where are docs? Need Simple python script for manuvering #76

Open
itskd opened this issue Mar 25, 2021 · 4 comments
Open

Where are docs? Need Simple python script for manuvering #76

itskd opened this issue Mar 25, 2021 · 4 comments

Comments

@itskd
Copy link

itskd commented Mar 25, 2021

Can someone give a simple example of how to plan path and make fixed wing follow dubins path.
I created a simple scipt for path planning, but nothing happens when i run this.
I just want a fixed wing to go from point a to b, can someone help me achieve this!!

from rosplane_msgs.msg import Waypoint

rospy.init_node('rc_pp')
#rc_pub = rospy.Publisher('/multirotor/RC', RCRaw, queue_size=10)
rc_pub = rospy.Publisher('/fixedwing/rosplane_simple_path_planner', Waypoint, queue_size=10)

rate = rospy.Rate(1)

msg = Waypoint()

msg.w[0]= 1111
msg.w[1] = 1111
msg.w[2]= 1111
msg.chi_d = 0.9
msg.chi_valid = True
msg.Va_d = 12
msg.set_current = True
msg.clear_wp_list = False
rc_pub.publish(msg)
print(msg)
rate.sleep()

@gellings
Copy link
Member

I looks like there is an example of publishing a waypoint list:

new_waypoint.w[0] = wps[i*5 + 0];

There is also an example launch file: https://github.com/byu-magicc/rosplane/blob/RC1.0/rosplane_sim/launch/fixedwing.launch

From what I can see the python example you posted should work. It will just fly you 1111 meters down (below the ground plane in gazebo). There is also some documentation in the message definition: https://github.com/byu-magicc/rosplane/blob/RC1.0/rosplane_msgs/msg/Waypoint.msg

Most of the rest of the documentation is in the textbook http://uavbook.byu.edu/doku.php

Hope this helps!

@cgnarendiran
Copy link

Hey guys,

Launching roslaunch rosplane_sim fixedwing.launch, that contains the rosplane_path_planner node. However, the plane doesn't move at all. It seems like the node is sending waypoints. But, I could not see any messages being published in the topic /fixedwing/waypoint_path that this node advertises.

So I tried to run this node separately (rosrun rosplane rosplane_path_planner __ns:=fixedwing) without the launch file and it seems to work fine. I could echo the topic and see three messages published before the node dies. But for some reason with the gazebo launched, the node sleeps for infinite time (more than the given ros::Duration(0.5).sleep()). Any ideas as to what is happening?

@gellings
Copy link
Member

It seems to work for me... Can you give more details about your setup?

Also don't forget to push play in gazebo (bottom left of the gazebo window). It starts "paused" by default.

@cgnarendiran
Copy link

Ahh! That was it. I didn't notice that Gazebo is launched in paused state. It works now.

When launching in the unpaused mode (setting <arg name="paused" value="false"/>), the plane doesn't move however. The path_planner node published all the messages and died before the path_manager could get its hands on those messages. A better solution instead of pausing in Gazebo is to use ROS Services instead of Topics since this is clearly an asynchronous communication. I will send a PR if I implement it.

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

No branches or pull requests

3 participants