Gazebo | Ignition | Community
Ask Your Question

Ash_100's profile - activity

2018-05-24 04:40:23 -0500 received badge  Famous Question (source)
2018-05-24 04:40:23 -0500 received badge  Notable Question (source)
2018-05-24 04:40:23 -0500 received badge  Popular Question (source)
2018-01-31 16:41:23 -0500 received badge  Famous Question (source)
2018-01-31 16:35:13 -0500 received badge  Famous Question (source)
2018-01-31 16:35:13 -0500 received badge  Notable Question (source)
2017-12-11 11:40:39 -0500 received badge  Famous Question (source)
2017-11-20 09:13:19 -0500 received badge  Famous Question (source)
2017-11-20 08:28:51 -0500 received badge  Notable Question (source)
2017-11-07 11:42:50 -0500 received badge  Notable Question (source)
2017-10-16 08:39:41 -0500 commented answer Hokuyo Senser not working

Yes, /hokuyo_laser is present. However, Gazebo crashes when I select the topic on RViZ.

2017-10-13 08:35:16 -0500 commented question Hokuyo Senser not working

Please say more about what do you mean from the standard description of the Turtlebot. I am using the launch files provi

2017-10-13 08:33:21 -0500 received badge  Notable Question (source)
2017-10-13 03:48:31 -0500 received badge  Popular Question (source)
2017-10-12 09:19:29 -0500 edited question Hokuyo Senser not working

Hokuyo Senser not working Hi, I am using ROS kinetic and Gazebo 7.8.1 I want to connect Hokuyo sensor to Turtlebot. I c

2017-10-12 09:18:31 -0500 received badge  Editor (source)
2017-10-12 09:18:31 -0500 edited question Hokuyo Senser not working

Hokuyo Senser not working Hi, I am using ROS kinetic and Gazebo 7.8.1 I want to connect Hokuyo sensor to Turtlebot. I c

2017-10-12 09:17:58 -0500 received badge  Enthusiast
2017-10-12 06:36:02 -0500 received badge  Popular Question (source)
2017-10-11 17:25:02 -0500 asked a question Hokuyo Senser not working

Hokuyo Senser not working Hi, I am using ROS kinetic and Gazebo 7.8.1 I want to connect Hokuyo sensor to Turtlebot. I c

2017-10-09 12:06:40 -0500 received badge  Famous Question (source)
2017-10-07 10:14:29 -0500 received badge  Notable Question (source)
2017-10-06 18:42:36 -0500 received badge  Popular Question (source)
2017-10-06 15:14:18 -0500 marked best answer Light message not working

i am trying to load a light using light message but it is not working. Here is the code

namespace gazebo { class WorldPluginTutorial : public WorldPlugin { public: WorldPluginTutorial() : WorldPlugin() { printf("Hello World!\n"); }

public: void Load(physics::WorldPtr _world, sdf::ElementPtr _sdf)
        {
          printf("Hello World Load!\n");
      this->model = _world;
          printf("%s\n", (this->model->GetName()).c_str());

          // Initialize ros, if it has not already bee initialized.
        if (!ros::isInitialized())
        {
            int argc = 0;
            char **argv = NULL;
            ros::init(argc, argv, "gazebo_client",
            ros::init_options::NoSigintHandler);
        }

            // Create our ROS node. This acts in a similar manner to
        // the Gazebo node
        this->rosNode.reset(new ros::NodeHandle("gazebo_client"));

        // Create a named topic, and subscribe to it.
        ros::SubscribeOptions so =
        ros::SubscribeOptions::create<std_msgs::Float32>(
            "/" + this->model->GetName() + "/vel_cmd",
            1,
            boost::bind(&WorldPluginTutorial::OnRosMsg, this, _1),
            ros::VoidPtr(), &this->rosQueue);
        this->rosSub = this->rosNode->subscribe(so);

            // Spin up the queue helper thread.
        this->rosQueueThread =
            std::thread(std::bind(&WorldPluginTutorial::QueueThread, this));

        }
    public: void OnRosMsg(const std_msgs::Float32ConstPtr &_msg)
    {
        //this->SetVelocity(_msg->data);
    printf("Entered WorldPluginTutorial::OnRosMsg\n");
        //w->InsertModelFile("model://sun");
    //physics::WorldPtr w = this->model->GetWorld();
    //unsigned int i = this->model->LightCount();
    sdf::SDF point;
    point.SetFromString("<?xml version='1.0' ?>\
        <sdf version='1.5'>\
        <!-- Light Source -->\
        <light name='point_light' type='point'>\
                <pose frame=''>2 -2 1 0 -0 0</pose>\
                <diffuse>0.5 0.5 0.5 1</diffuse>\
                <specular>0.1 0.1 0.1 1</specular>\
                <attenuation>\
                    <range>20</range>\
                    <constant>0.5</constant>\
                    <linear>0.01</linear>\
                    <quadratic>0.001</quadratic>\
                </attenuation>\
                <cast_shadows>0</cast_shadows>\
                <direction>0 0 -1</direction>\
        </light>\
        </sdf>");
    sdf::ElementPtr light = point.Root()->GetElement("light");
    msgs::Light msg = gazebo::msgs::LightFromSDF(light);
    //this->model->LoadLigt(light);
    transport::NodePtr node(new transport::Node());

    node->Init(this->model->GetName());

    transport::PublisherPtr lightPub 
        = node->Advertise<msgs::Light>("~/light");

    lightPub->Publish(msg);

    unsigned int i = this->model->Lights().size();
        printf("Light count = %d\n", i);    
        //w->InsertModelFile("model://sun");
        //w->InsertModelFile("model://sun");
    }

/// \brief ROS helper function that processes messages
    private: void QueueThread()
    {
        static const double timeout = 0.01;
        while (this->rosNode->ok())
        {
                this->rosQueue.callAvailable(ros::WallDuration(timeout));
        }
    }
    private: physics::WorldPtr model;
private: std::unique_ptr<ros::NodeHandle> rosNode;
    /// \brief A ROS subscriber
    private: ros::Subscriber rosSub;

    /// \brief A ROS callbackqueue that helps process messages
    private: ros::CallbackQueue rosQueue;

    /// \brief A thread the keeps running the rosQueue
    private: std::thread rosQueueThread;

}; GZ_REGISTER_WORLD_PLUGIN(WorldPluginTutorial) }

2017-10-06 15:14:17 -0500 received badge  Popular Question (source)
2017-10-06 14:00:33 -0500 commented answer Light message not working

Thanks ~/factory/light works, but still there is an issue. Light is added but not visible. When I send the same message

2017-10-06 13:59:02 -0500 commented answer Light message not working

Thanks it works but still there is an issue. Light is added but not visible. When I send the same message next time I ge

2017-10-06 09:36:00 -0500 marked best answer Upgrade from Gazebo 7 to 7.1

How can I upgrade from Gazebo 7.0 to 7.1? I am using ROS Kinetic and Ubuntu 16.04

2017-10-06 09:27:26 -0500 received badge  Famous Question (source)
2017-10-06 08:36:55 -0500 commented answer Upgrade from Gazebo 7 to 7.1

I tried this. It upgrades to Gazebo7 not Gazebo7.1.

2017-10-06 08:35:47 -0500 commented question InsertModelFile("model://sun")

This seems to be a bug in Gazebo7. It works fine in Gazebo2

2017-10-06 08:29:30 -0500 asked a question Works in Gazebo2 bot NOT in Gazebo7

Works in Gazebo2 bot NOT in Gazebo7 Turning on a light by loading a model is working in Gazebo2 but NOT in Gazebo7. I tr

2017-10-05 22:39:18 -0500 asked a question Light message not working

Light message not working i am trying to load a light using light message but it is not working. Here is the code names

2017-10-05 16:29:44 -0500 received badge  Notable Question (source)
2017-10-05 16:28:20 -0500 asked a question InsertModelFile("model://sun")

InsertModelFile("model://sun") I am trying to insert a "sun" light in the gazebo world. I am able to successfully use In

2017-10-05 14:16:59 -0500 received badge  Popular Question (source)
2017-10-04 19:45:48 -0500 marked best answer Different classes for Light

Please explain the difference between the two classes. "class gazebo::physics::Light" and "class gazebo::rendering::Light"

I want to turn on/off light dynamically using a gazebo model plugin. I am not sure which class and function should be used.

2017-10-04 19:45:46 -0500 received badge  Popular Question (source)
2017-10-04 08:16:25 -0500 received badge  Popular Question (source)
2017-10-03 15:21:42 -0500 asked a question Upgrade from Gazebo 7 to 7.1

Upgrade from Gazebo 7 to 7.1 How can I upgrade from Gazebo 7.0 to 7.1? I am using ROS Kinetic and Ubuntu 16.04

2017-10-03 13:33:11 -0500 commented answer Add a light to Turtlebot

Thanks. I am already using it. I was able to build it successfully and test it. But I have two questions (1) How to dyna

2017-10-03 12:31:36 -0500 asked a question Add a light to Turtlebot

Add a light to Turtlebot How can I add a structure indicating head-lamp to Turtlebot and then attached point/spot light

2017-10-03 08:13:50 -0500 asked a question Different classes for Light

Different classes for Light Please explain the difference between the two classes. "class gazebo::physics::Light" and "

2017-10-02 10:03:33 -0500 commented answer error: ‘class gazebo::physics::World’ has no member named ‘LightCount’

How to update 7.0.0 to 7.1.1? Basically, I want to add/remove lights from the world. Therefore, I need to access API rel

2017-10-02 10:01:50 -0500 marked best answer error: ‘class gazebo::physics::World’ has no member named ‘LightCount’

I am using Gazebo 7 with ROS kinetic on Ubuntu 16.04. I wrote a small gazebo plugin with gets loaded when I load a world in gazebo. However, when I try to use LightCount API, I get the compile error saying "error: ‘class gazebo::physics::World’ has no member named ‘LightCount’".
Here is the link that says that this API is supported http://osrf-distributions.s3.amazonaw...

Here is the code snippet that is giving me error
   // Called by the world update start event
    public: void OnUpdate(const common::UpdateInfo & /*_info*/)
    {
       physics::WorldPtr w = this->model->GetWorld();
       unsigned int i = w->LightCount();
       printf("Light count = %d\n", i); 
    }
2017-10-02 10:01:50 -0500 received badge  Scholar (source)
2017-10-02 09:20:59 -0500 asked a question error: ‘class gazebo::physics::World’ has no member named ‘LightCount’

error: ‘class gazebo::physics::World’ has no member named ‘LightCount’ I am using Gazebo 7 with ROS kinetic on Ubuntu 16