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

Send vehicle control commands only when reciving ROS input #22

Merged
merged 3 commits into from Jan 7, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/carla_ros_bridge/ego_vehicle.py
Expand Up @@ -161,8 +161,15 @@ def apply_control(self):
vehicle_control.steer = self.info.output.steer
vehicle_control.throttle = self.info.output.throttle
vehicle_control.reverse = self.info.output.reverse
# send control command out
self.carla_actor.apply_control(vehicle_control)

# send control command out, if there is a ROS control publisher
ros_control_topic = rospy.get_published_topics(namespace=self.topic_name() + "/ackermann_cmd")
print(ros_control_topic)
fabianoboril marked this conversation as resolved.
Show resolved Hide resolved
ros_control_topic.extend(rospy.get_published_topics(namespace=self.topic_name() + "/vehicle_control_cmd"))
print(ros_control_topic)
fabianoboril marked this conversation as resolved.
Show resolved Hide resolved
if ros_control_topic:
self.carla_actor.apply_control(vehicle_control)


def update_current_values(self):
"""
Expand Down