ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

zuygar's profile - activity

2021-02-23 03:19:50 -0500 received badge  Scholar (source)
2020-06-03 04:44:29 -0500 commented question Controlling Gazebo Cessna Plane with ROS

Hi, if you have solved this issue could you please share your solution ? Thanks...

2016-07-17 15:17:35 -0500 received badge  Student (source)
2016-06-30 08:32:22 -0500 received badge  Famous Question (source)
2016-04-07 17:24:46 -0500 received badge  Notable Question (source)
2016-03-14 04:03:34 -0500 commented answer Unable to install Turtlebot

I am also gettin this error. I tried your solution but I still get same error.

2016-03-10 06:54:23 -0500 commented answer How to get gazebo topic using c++ and ros ?

I can't see any topic like above running "rostopic list". But if I run "gztopic list" I can see some topics like this:

/gazebo/default/pose/local/info

/gazebo/default/pose/info

/gazebo/default/gui

/gazebo/default/response

/gazebo/default/world_stats

/gazebo/default/selection

2016-03-10 04:23:30 -0500 received badge  Popular Question (source)
2016-03-09 10:16:38 -0500 asked a question How to get gazebo topic using c++ and ros ?

Hi, I am using ROS, gazebo and c++ together to perform some tasks. In gazebo I launched "turtlebot_world.launch. It published " /gazebo/default/pose/info " which gives the information of robots position in gazebo. How can I take this topic in c++, does anyone knows ?

Also I have the function below but doesn't take any information or topic:

void subscribe_gazebo_pose()
{
    ros::NodeHandle ndh;
    ros::ServiceClient gms_c = ndh.serviceClient<gazebo_msgs::GetModelState>("gazebo/default/pose/info");
    //gms_c.waitForExistence();
    gazebo_msgs::GetModelState getmodelstate;
    gms_c.call(getmodelstate);

    geometry_msgs::Pose pose;
    pose.position.x = getmodelstate.response.pose.position.x;
    pose.position.y = getmodelstate.response.pose.position.y;
    cout << pose.position.x << endl;
}
2016-03-09 08:30:00 -0500 commented question Get model state in gazebo does not exist

I have also the same error in ros. If you solved it, can you please share your solution ?

2016-03-03 12:34:29 -0500 received badge  Famous Question (source)
2015-11-06 06:02:38 -0500 received badge  Enthusiast
2015-11-04 03:47:27 -0500 received badge  Notable Question (source)
2015-08-31 06:37:05 -0500 received badge  Popular Question (source)
2015-06-07 01:33:07 -0500 received badge  Famous Question (source)
2015-03-22 03:45:10 -0500 received badge  Popular Question (source)
2015-02-12 08:45:38 -0500 asked a question Changing Executable Path

When i built a cpp file in a ros project (after "catkin_make" command) the executable occurs in the path /devel/lib. But i want it to occur in /src . How can i change the built file's directory ?

2015-02-12 05:15:16 -0500 received badge  Supporter (source)
2015-02-11 20:23:52 -0500 received badge  Teacher (source)
2015-02-11 20:23:52 -0500 received badge  Self-Learner (source)
2015-02-11 20:14:33 -0500 received badge  Notable Question (source)
2015-02-11 09:48:57 -0500 answered a question Publishing and Subscribing at the same time

Ok i fixed the problem. My code is following, but i have a confusion about "delete pub" command. If i wouldn'd use this, what happened ?

#include <ros/ros.h>
#include <turtlesim/Pose.h>
#include <iomanip>
#include <geometry_msgs/Twist.h>
#include <stdlib.h>

ros::Publisher *pub;

void poseMessageRecieved(const turtlesim::Pose& msgIn) {
geometry_msgs::Twist msg;
ROS_INFO_STREAM(std::setprecision(2) << std::fixed
<< "position=(" << msgIn.x << "," << msgIn.y << ")"
<< "direction=" << msgIn.theta); 
msg.linear.x=0.2;
msg.angular.z=0.1;
pub->publish(msg);
ROS_INFO_STREAM("Sending constant velocity command: "<< "linear=" <<msg.linear.x << "angular=" << msg.angular.z);
}

int main(int argc,char **argv) {
ros::init(argc, argv, "sub_and_pub");
ros::NodeHandle nh;

pub = new ros::Publisher(nh.advertise<geometry_msgs::Twist>("turtle1/cmd_vel", 1000));
ros::Subscriber sub = nh.subscribe("turtle1/pose", 1000, &poseMessageRecieved);

ros::spin();

delete pub;
}
2015-02-11 09:15:37 -0500 received badge  Popular Question (source)
2015-02-11 07:39:47 -0500 received badge  Editor (source)
2015-02-11 07:28:21 -0500 asked a question Publishing and Subscribing at the same time

I am trying to send constant velocity commands to turtlesim and at the same time want to recieve pose information. I am only recieving pose data in terminal when i runing both turtlesim and roscore.

My code is following:

#include <ros/ros.h>
#include <turtlesim/Pose.h>
#include <iomanip>
#include <geometry_msgs/Twist.h>
#include <stdlib.h>

void poseMessageRecieved(const turtlesim::Pose& msg) {

ROS_INFO_STREAM(std::setprecision(2) << std::fixed
<< "position=(" << msg.x << "," << msg.y << ")"
<< "direction=" << msg.theta); 

}

int main(int argc,char **argv) {
ros::init(argc, argv, "sub2");
ros::NodeHandle nh;
ros::Subscriber sub=nh.subscribe("turtle1/pose", 1000, &poseMessageRecieved);
ros::spin();

ros::init(argc, argv, "pub2");
ros::Publisher pub=nh.advertise<geometry_msgs::Twist>("turtle1/cmd_vel", 1000);
ros::Rate rate(2);

while(ros::ok()) {
geometry_msgs::Twist msg;

msg.linear.x=2.0;
msg.angular.z=1.0;

pub.publish(msg);
ROS_INFO_STREAM("Sending constant velocity command: "<< "linear=" <<msg.linear.x << "angular=" << 
msg.angular.z);

ros::spinOnce();
rate.sleep();
}

//ros::spin();
}
2015-02-07 07:41:24 -0500 answered a question parse error

Thank you very much. I fixed the problem. You are right. Somethink in the CmakeLists file was wrong. :)

2015-02-06 07:29:51 -0500 asked a question parse error

I am using ros hydro and studying ros tutorials in wiki.ros.org . At 11th tutorial i tried to write a publisher and subscriber. At last step "catkin_make" command had an error as below:

CMake Error: Error in cmake code at /home/meam/catkin_ws/src/beginner_tutorials/CMakeLists.txt:168: Parse error. Expected "(", got newline with text " ". -- Configuring incomplete, errors occurred! make: * [cmake_check_build_system] Error 1 Invoking "make cmake_check_build_system" failed

So what is the problem ?