Set up nodes for joystick (XBox) controller#7
Conversation
|
Let's make changes to |
|
|
||
| <!-- Joystick controller node (listens to XBox controller for service calls). --> | ||
| <node name="joystick_controller" pkg="crazyflie_demo" type="controller.py" output="screen"> | ||
| <param name="use_crazyflie_controller" value="True" /> |
There was a problem hiding this comment.
Not sure what this use_crazyflie_controller parameter does but I suspect we'll need to look at the source code for this node and make sure it calls the right services. Alternatively (preferably) we can rename the services used by crazyflie_takeoff to match the ones assumed by the joystick.
There was a problem hiding this comment.
Yup, I agree, I think it's the cleanest thing: we just provide the same interface with an alternative implementation of the services.
Regarding the use_crazyflie_controller argument, it seems this simply tells the controller whether or not to look for the takeoff and land services and set up the corresponding proxies (which then get called by a Subscriber set up by the controller node listening to the \joy topic); the emergency proxy is always set up regardless.
From crazyflie_demo's controller.py:
if use_controller:
rospy.loginfo("waiting for land service")
rospy.wait_for_service('land')
rospy.loginfo("found land service")
self._land = rospy.ServiceProxy('land', Empty)
rospy.loginfo("waiting for takeoff service")
rospy.wait_for_service('takeoff')
rospy.loginfo("found takeoff service")
self._takeoff = rospy.ServiceProxy('takeoff', Empty)
else:
self._land = None
self._takeoff = NoneThere was a problem hiding this comment.
(Also, killing it with markdown :P)
There was a problem hiding this comment.
It looks like we're already calling our services /takeoff and /land respectively. The controller.cpp file defines the services as takeoff and land, but I think the slash doesn't make a difference here.
Based on this it looks like all that would be left would be implementing the emergency service. By the way, I'm not sure who implements their emergency service, currently, it's not controller.cpp.
|
Hmm ok let’s just try this then once the launch file runs. We can look into the emergency landing later.
…Sent from my iPhone
On Aug 28, 2018, at 8:31 PM, Jaime F. Fisac ***@***.***> wrote:
@jfisac commented on this pull request.
In ros/src/fastpeople/launch/software_crazyflie_launcher.launch:
> @@ -290,4 +290,10 @@
<param name="topics/final_control" value="$(arg final_control_topic)" />
<param name="topics/in_flight" value="$(arg in_flight_topic)" />
</node>
+
+ <!-- Joystick controller node (listens to XBox controller for service calls). -->
+ <node name="joystick_controller" pkg="crazyflie_demo" type="controller.py" output="screen">
+ <param name="use_crazyflie_controller" value="True" />
It looks like we're already calling our services /takeoff and /land respectively. The controller.cpp file defines the services as takeoff and land, but I think the slash doesn't make a difference here.
Based on this it looks like all that would be left would be implementing the emergency service. By the way, I'm not sure who implements their emergency service, currently, it's not controller.cpp.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This allows the XBox controller to call services. The code in the controller node (from crazyflie_clean) calls the Takeoff, Land and Emergency services; it's originally meant to work for the implementations given by the default crazyflie ROS code, but in principle should work out of the box with our own implementations of the services.
TODO: