Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ros/src/fastpeople/launch/software_crazyflie_launcher.launch
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

@jfisac jfisac Aug 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 = None

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Also, killing it with markdown :P)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

<param name="joy_topic" value="/joy" />
</node>
</launch>
8 changes: 8 additions & 0 deletions ros/src/fastpeople/launch/software_demo.launch
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<arg name="collision_check_resolution" default="0.33" />
<arg name="grid_resolution" default="0.33" />

<!-- Hardware interfaces. -->
<arg name="joy_dev" default="/dev/input/js0" />

<!-- Record a rosbag. -->
<node pkg="rosbag"
type="record"
Expand All @@ -21,6 +24,11 @@
if="$(arg record)">
</node>

<!-- Joystick (XBox controller) publisher node. -->
<node name="joy" pkg="joy" type="joy_node" output="screen">
<param name="dev" value="$(arg joy_dev)" />
</node>

<!-- ========================== Robot 1. ========================== -->
<include file="$(find fastpeople)/launch/software_crazyflie_launcher.launch">
<arg name="suffix" value="$(arg robot1)" />
Expand Down