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

Help needed on rmf_obstacle_laserscan_detector #9

Open
HappySamuel opened this issue Jan 31, 2023 · 10 comments
Open

Help needed on rmf_obstacle_laserscan_detector #9

HappySamuel opened this issue Jan 31, 2023 · 10 comments

Comments

@HappySamuel
Copy link

Hi

I managed to have everything compiled, it shown hooked up on rqt node_graph. However when i place an obstacle in front of laserscanner, it complaints about no frame_id for header when being subscribed into lane_blocker node.

Complaint message from Lane Blocker
Screenshot from 2023-01-31 17-34-21

ROS2 topic echo of /rmf_obstacles
Screenshot from 2023-01-31 17-34-34

Launch File settings
Screenshot from 2023-01-31 17-34-54

How shall i fill the frame_id for header msg of topic /rmf_obstacles ?

Best,
Samuel

@Yadunund
Copy link
Member

The obstacle detector is reporting the pose of the object wrt to frame lidar_link. The lane blocker has rmf_frame_id set to map. You'll need to provide a static transformation between the rmf_frame_id and map frames. You can use tf2_ros/static_transform_publisher for this.

@HappySamuel
Copy link
Author

HappySamuel commented Feb 1, 2023

Hi @Yadunund

I have tried adding the tf2_ros/static_transform_publisher, but it doesn't help to solve the issue. The /rmf_obstacles topic is still having the header.frame_id remain '', while all obstacles' header.frame_id have their own, ex: lidar_link. Thus, I dig further down and found that it's because there's no define of header.frame_id for the msg in the code, although the obstacles.msg has header.frame_id of it.

rmf_obstacle_detector_laserscan/src/LaserscanDetector.cpp
Screenshot from 2023-02-01 10-45-36

rmf_obstacle_msgs/msg/Obstacles.msg
Screenshot from 2023-02-01 10-45-58

Could this be the root cause to this issue?

Best,
Samuel

@HappySamuel
Copy link
Author

HappySamuel commented Feb 1, 2023

Hi @Yadunund

I try to ament the code by adding one line (Commented with //SAMUEL), and then the lane_blocker no longer discard the msg.
Screenshot from 2023-02-01 11-17-12

However, on the rviz, neither lane closure shown nor rerouting happen.
Screenshot from 2023-02-01 11-16-19
Any idea what am i missing?

Best
Samuel

@Yadunund
Copy link
Member

Yadunund commented Feb 1, 2023

Please avoid pasting screenshots of texts. It's better if you can copy paste the text directly here or best if you can paste the text into a gist and share the link.

Looks like this implementation of the detectors has not been updated since that header field was added to the Obstacles msg. You're on the right track but setting the frame id to map is not correct. You should set it to the same header as the laser scan.

msg->header.frame_id = _laser_scan->header.frame_id;

Let me know if that works.

@HappySamuel
Copy link
Author

HappySamuel commented Feb 1, 2023

Hi @Yadunund

Yes, after adding this line of code msg->header.frame_id = _laser_scan->header.frame_id; lane_blocker no longer complaints about the empty header.frame_id anymore.

But still, neither lane closure nor rerouting of path happen or shown in RVIZ. I checked the rqt node_graph and found my current linkage between as following
gazebo -> /scan -> laserscan_detector -> /rmf_obstacles -> lane_blocker -> /lane_closure_requests -> tinyRobot_command_handle -> /closed_lanes

Lane_blocker has 3 inputs: /rmf_obstacles, /nav_graphs, /lane_states and 3 of them all have incoming msgs.
2 outputs: /lane_closure_requests, /speed_limit_requests and none of these 2 have outgoing msgs.

Anything i missed to have the lane_blocker to publish msg to this topic /lane_closure_requests? because nothing come out at all.

Best
Samuel

@Yadunund
Copy link
Member

Yadunund commented Feb 1, 2023

I'm not seeing any obstacle visualized in rviz. You should see a green marker that represents the obstacle if detected correctly and the frame transforms exist. Maybe before running lane_blocker, try to get the obstacle visualized in rviz.

@HappySamuel
Copy link
Author

HappySamuel commented Feb 1, 2023

Hi @Yadunund

Originally, I couldn't get the green marker shown by /fleet_markers on RVIZ. But now i found that it's because of the obstacle_visualizer_node has died off.

Regarding the obstacle_visualizer_node that suppose to publish the obstacles to /fleet_markers, it will die after receiving /rmf_obstacles msg. No further details found, only error as below.
[ERROR] [obstacle_visualizer_node-4]: process has died [pid 13885, exit code -11, cmd '/opt/ros/humble/lib/rmf_visualization_obstacles/obstacle_visualizer_node --ros-args --params-file /tmp/launch_params_6_bkopyo --params-file /tmp/launch_params_n1von22x --params-file /tmp/launch_params_ka2tvxgz']

I found that this only happens if rmf_visualization_obstacles package is installed via apt install. However, if using git clone the rmf_visualization source code and compile it, will not suffer this error.

Best
Samuel

@HappySamuel
Copy link
Author

HappySamuel commented Feb 1, 2023

Hi @Yadunund

Although i am able to have the green marker shown on RVIZ for the obstacles detected. But the closing of the lane will only stay for short period, and then it will auto re-open again even though the same obstacles are still there. Any idea, what parameters shall i modify for lane_blocker_node ? Couldn't find any ReadME regarding the parameters used for lane_blocker_node.

I have tried to adjust the cull_rate to smaller ( = Longer time), but it only will extend the time for the lane to remain closed. Afterward it will re-open the lane again eventhough the obstacle is still there. What shall i do, if i want to have the lane to be opened / closed based on the existence of obstacle?

Best,
Samuel

@TheConstructAi
Copy link

Hi,

Having similar issues. In my case the obstacle detection works, until I replace the existing messages by the ones recommended by @Yadunund MESSAGES.

I replaced without issues the rmf_visualization package without issues, but if I add those messages, even without compiling the rmf_obstacle_ros2, the obstacle publication in RVIZ just stops working.

Any ideas on how this can be setup to make it work, because its a pitty that its doesn't work for what it seems some kind of inpatibility obstacle detector?

@eeoon
Copy link

eeoon commented Sep 13, 2023

Hi. @HappySamuel

i have similar issues. first, i can't have the green marker shown on RVIZ for the obstacles detected. how do you that? I see the READMD. but hint is not comment. i try the simulation of rmf_demos office.launch.xml and I just place unit_BOX in gazebo but there are no visualization in RVIZ (no green marker..)

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

No branches or pull requests

4 participants