robotics-upo / nav2_social_costmap_plugin

Plugin-based layer for social navigation in the Nav2 system of ROS2
MIT License
15 stars 6 forks source link

social costmap plugin problem in humble #1

Closed dharanish-nh closed 1 month ago

dharanish-nh commented 1 year ago

I am using your Foxy package to run in humble. while doing so I stumbled upon some problems. I was hoping you could help me out with this issue.

  1. Cloning it directly to the workspace. Then trying to colcon build gives an error as follows. `/pplsub = node_->create_subscription( "/people", rclcpp::SensorDataQoS(), std::bind(&SocialLayer::peopleCallback, this, std::placeholders::_1));

/home/bot/humble_ws/src/nav2_social_costmap_plugin/src/social_layer.cpp:36:20: error: base operand of ‘->’ has non-pointer type ‘rclcpp_lifecycle::LifecycleNode::WeakPtr’ {aka ‘std::weak_ptr’} 36 | RCLCPPINFO(node->get_logger() `

  1. According to the error I changed "node" to "node.lock()". then I get no errors while building. But when I run the simulation the robot does not navigate and does not show any errors. here is a video https://www.youtube.com/watch?v=FY26voZv02E . [https://www.youtube.com/watch?v=FY26voZv02E]

  2. modified code snippets

i.ppl_sub_= node_.lock()->create_subscription<people_msgs::msg::People>( "/people", rclcpp::SensorDataQoS(), std::bind(&SocialLayer::peopleCallback, this,std::placeholders::_1));

RCLCPPINFO(node.lock()->get_logger(), "SocialLayer: subscribed to " "topic %s", pplsub->get_topic_name());`

ii. void SocialLayer::get_parameters() { node_.lock()->get_parameter(name_ + "." + "enabled", enabled_); node_.lock()->get_parameter(name_ + "." + "cutoff", cutoff_); node_.lock()->get_parameter(name_ + "." + "amplitude", amplitude_); node_.lock()->get_parameter(name_ + "." + "covariance_front_height", sigma_front_height_); node_.lock()->get_parameter(name_ + "." + "covariance_front_width", sigma_front_width_); node_.lock()->get_parameter(name_ + "." + "covariance_rear_height", sigma_rear_height_); node_.lock()->get_parameter(name_ + "." + "covariance_rear_width", sigma_rear_width_); node_.lock()->get_parameter(name_ + "." + "covariance_right_height", sigma_right_height_); node_.lock()->get_parameter(name_ + "." + "covariance_right_width", sigma_right_width_); node_.lock()->get_parameter(name_ + "." + "covariance_when_still", sigma_when_still_); node_.lock()->get_parameter(name_ + "." + "use_passing", use_passing_); node_.lock()->get_parameter(name_ + "." + "use_vel_factor", use_vel_factor_); node_.lock()->get_parameter(name_ + "." + "speed_factor_multiplier", speed_factor_); node_.lock()->get_parameter(name_ + "." + "publish_occgrid", publish_occgrid_); }

I kindly request you help me out in understanding this issue. @noeperez

noeperez commented 1 year ago

Hi! It is very difficult to me to know the error since I have not check the plugin in Humble. We will make the Humble version but that will not be soon.
Sorry, I can not help you for the moment.

noeperez commented 9 months ago

Hey @dharanish-nh, probably it is too late, but finally we adapted the code to Humble (default branch now). Now we have available the plugin for Foxy and Humble distros.

dharanish-nh commented 9 months ago

Hey @noeperez , unfortunately, I finished the project recently with an alternative solution. Thank you now I can check how it works with the social layer.