Skip to content
This repository has been archived by the owner on Feb 21, 2021. It is now read-only.

minimal support for ros drones #1234

Merged
merged 5 commits into from
Jul 4, 2018
Merged
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
15 changes: 13 additions & 2 deletions src/libs/comm_py/comm/ardroneextraClient.py.ros.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
import Ice
from .ice.ardroneextraIceClient import ArDroneExtraIceClient
from .ros.publisherExtra import PublisherExtra
from .tools import server2int


Expand Down Expand Up @@ -37,8 +38,18 @@ def __getPublisherArDroneExtra(jdrc, prefix):

'''

print(prefix + ": This Interface doesn't support ROS msg")
return None
if (sys.version_info[0] == 2):
print("Publishing "+ prefix + " with ROS messages")
topicarming = jdrc.getConfig().getProperty(prefix+".TopicArming")
topicland = jdrc.getConfig().getProperty(prefix+".TopicLand")
topicSetMode = jdrc.getConfig().getProperty(prefix+".TopicSetMode")
topicvel = jdrc.getConfig().getProperty(prefix+".TopicVel")

client = PublisherExtra(topicarming,topicland, topicSetMode, topicvel, jdrc)
return client
else:
print(prefix + ": ROS msg are diabled for python "+ sys.version_info[0])
return None

def __ArDroneExtradisabled(jdrc, prefix):
'''
Expand Down
24 changes: 22 additions & 2 deletions src/libs/comm_py/comm/cmdvelClient.py.ros.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
import Ice
from .ice.cmdvelIceClient import CMDVelIceClient
from .ros.publisherCmdVel import PublisherCMDVel
from .tools import server2int


Expand Down Expand Up @@ -37,8 +38,27 @@ def __getPublisherCMDVel(jdrc, prefix):

'''

print(prefix + ": This Interface doesn't support ROS msg")
return None
'''
Returns a CMDVel ROS Publisher. This function should never be used. Use getCMDVelClient instead of this

@param jdrc: Comm Communicator
@param prefix: Name of client in config file

@type jdrc: Comm Communicator
@type prefix: String

@return CMDVel ROS Publisher

'''
if (sys.version_info[0] == 2):
print("Publishing "+ prefix + " with ROS messages")
topic = jdrc.getConfig().getProperty(prefix+".Topic")

client = PublisherCMDVel(topic, jdrc)
return client
else:
print(prefix + ": ROS msg are diabled for python "+ sys.version_info[0])
return None

def __CMDVeldisabled(jdrc, prefix):
'''
Expand Down
Loading