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

correct position of walkers. #648

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
14 changes: 14 additions & 0 deletions carla_ros_bridge/src/carla_ros_bridge/walker.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
Classes to handle Carla pedestrians
"""

import carla_common.transforms as trans
from carla import WalkerControl

from carla_ros_bridge.traffic_participant import TrafficParticipant
Expand Down Expand Up @@ -82,6 +83,19 @@ def control_command_updated(self, ros_walker_control):
walker_control.jump = ros_walker_control.jump
self.carla_actor.apply_control(walker_control)

def get_current_ros_pose(self):
"""
Function to return the pose for walkers.

:return: the pose of the walker
:rtype: geometry_msgs.msg.Pose
"""
# Moving position of walkers from the pivot point to the bottom of the bounding box.
extent = self.carla_actor.bounding_box.extent
pose_transform = self.carla_actor.get_transform()
pose_transform.location -= pose_transform.get_up_vector() * extent.z
return trans.carla_transform_to_ros_pose(pose_transform)

def get_classification(self):
"""
Function (override) to get classification
Expand Down