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

added a fake laserscanner #56

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hsd-dev
Copy link

@hsd-dev hsd-dev commented Nov 9, 2020

Related to #52

By default publishes the laser scan from /scan topic as it is:

roslaunch metacontrol_sim fake_laserscanner_bringup.launch

The data can be "corrupted" by adding a transformation function:

roslaunch metacontrol_sim fake_laserscanner_bringup.launch range_transformer:='[0 for x in m.ranges]'

@hsd-dev
Copy link
Author

hsd-dev commented Nov 9, 2020

@chcorbato

@hsd-dev
Copy link
Author

hsd-dev commented Nov 9, 2020

One disadvantage I see with this method is that the scans cannot be changed to corrupted at runtime.

@marioney
Copy link
Member

marioney commented Nov 9, 2020

One disadvantage I see with this method is that the scans cannot be changed to corrupted at runtime.

This can be problematic. isn't it possible to add a service to change this?

@hsd-dev
Copy link
Author

hsd-dev commented Nov 9, 2020

isn't it possible to add a service to change this?

Working on it. Will add another commit.

@hsd-dev
Copy link
Author

hsd-dev commented Nov 9, 2020

Original code from here. Unfortunately, it not a python module. So copy-pasted with due credits

"""
@author: enriquefernandez
Original file: https://github.com/ros/ros_comm/blob/noetic-devel/tools/topic_tools/scripts/transform
CHANGES:
- added Lock to original TopicOp class
- added a service to change transform function at run-time
"""

The inherited class now exposes a service which can be used to "corrupt" the data:

rosservice call /transform_range "data: true"

The transformation function can be set as an arg in the launch file:

<arg name="transform_fn" default="[0 for x in m.ranges]" />

Currently the range values are simply set to 0s.

@chcorbato
Copy link
Member

@marioney can you review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants