-
Notifications
You must be signed in to change notification settings - Fork 990
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
Setpoint srv #127
Setpoint srv #127
Conversation
…ode; minor correction on safety_area
Ok I've checked that the same happens with the Update: solved by adding the # stick around long enough for others to grab
timeout_t = rospy.get_time() + _ONCE_DELAY
while not rospy.is_shutdown() and rospy.get_time() < timeout_t:
rospy.sleep(0.2)
print_if(pub.get_num_connections() < 1,
"Mavros not started, nobody subcsribes to ",
args.mavros_ns + "/safety_area/set") |
Ok I'm already adding setpoint position also. But I'm stuck on the parser = argparse.ArgumentParser(description="Commad line tool for control the device by setpoints.")
parser.add_argument('-n', '--mavros-ns', help="ROS node namespace", default="/mavros")
parser.add_argument('-v', '--verbose', action='store_true', help="verbose output")
subarg = parser.add_subparsers()
setp_local_pos_args = subarg.add_parser('local', help="Send local setpoint")
setp_local_pos_args.set_defaults(func=do_setp_local_vel)
setp_local_pos_args.add_argument('-pos', type=float, nargs=3, metavar=('x', 'y', 'z'),
required=True, help="Local position")
setp_local_vel_args = subarg.add_parser('local', help="Send local setpoint")
setp_local_vel_args.set_defaults(func=do_setp_local_vel)
setp_local_vel_args.add_argument('-vel', type=float, nargs=3, metavar=('vx', 'vy', 'vz'),
required=True, help="Linear velocity")
setp_global_pos_args = subarg.add_parser('global', help="Send global setpoint")
setp_global_pos_args.set_defaults(func=do_setp_global_vel)
setp_global_pos_args.add_argument('-pos', type=float, nargs=3, metavar=('x', 'y', 'z'),
required=True, help="Global position")
setp_global_vel_args = subarg.add_parser('global', help="Send global setpoint")
setp_global_vel_args.set_defaults(func=do_setp_global_vel)
setp_global_vel_args.add_argument('-vel', type=float, nargs=3, metavar=('vx', 'vy', 'vz'),
required=True, help="Linear velocity")
args = parser.parse_args(rospy.myargv(argv=sys.argv)[1:])
args.func(args) Need help to figure this out since the above doesn't work. (For example, |
I don't understand why you added duplicate topics? Also i think it's not handy to control using cmdline (some time ago, I tried to control the rover, and realized that it is very inconvenient). |
That's why I need your help to use the same topic to do different commands. Please right here a piece of code that will do the job and then I'll implement it in the rest.
It can be handy some times. Probably to test purposes first. |
Fix template bug that occurs when variable is used at the end of a repetition
Right now is working but there's a strange behaviour: when, for example, I issue the command
rosrun mavros mavsetp local -vel 1 0 0
, having themavros_node
running, I getMavros not started, nobody subcsribes to /mavros/setpoint/local/vel/set
.But if I do
rostopic echo /mavros/setpoint/local/vel/set
, it doesn't reply with the above. Any explanation for this based on the code I wrote?Thanks!