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

sueee's profile - activity

2022-09-11 11:05:38 -0500 received badge  Famous Question (source)
2021-12-11 10:12:08 -0500 received badge  Famous Question (source)
2021-12-11 10:12:08 -0500 received badge  Notable Question (source)
2021-12-11 10:12:08 -0500 received badge  Popular Question (source)
2021-06-24 11:49:49 -0500 edited question rospy subscriber delay, not giving the latest msg

rospy subscriber delay, not giving the latest msg I've been trying to use rospy.subscribe to pointcloud2 msg, but I foun

2021-06-23 23:47:42 -0500 received badge  Popular Question (source)
2021-06-23 23:46:57 -0500 edited question rospy subscriber delay, not giving the latest msg

rospy subscriber delay, not giving the latest msg I've been trying to use rospy.subscribe to pointcloud2 msg, but I foun

2021-06-23 23:46:49 -0500 edited question rospy subscriber delay, not giving the latest msg

rospy subscriber delay, not giving the latest msg I've been trying to use rospy.subscribe to pointcloud2 msg, but I foun

2021-06-23 23:44:14 -0500 edited question rospy subscriber delay, not giving the latest msg

rospy subscriber delay, not giving the latest msg I've been trying to use rospy.subscribe to pointcloud2 msg, but I foun

2021-06-23 23:43:53 -0500 asked a question rospy subscriber delay, not giving the latest msg

rospy subscriber delay, not giving the latest msg I've been trying to use rospy.subscribe to pointcloud2 msg, but I foun

2021-06-23 23:43:50 -0500 asked a question rospy subscriber delay, not giving the latest msg

rospy subscriber delay, not giving the latest msg I've been trying to use rospy.subscribe to pointcloud2 msg, but I foun

2021-05-07 05:55:59 -0500 received badge  Notable Question (source)
2021-04-22 07:26:37 -0500 received badge  Notable Question (source)
2021-01-17 21:38:35 -0500 edited question gazebo bumperlinktopic not published

gazebo bumperlinktopic not published Hi, I am trying to add a bumper on baxter.urdf.xacro via the rethink_electric_gripp

2021-01-17 21:38:05 -0500 asked a question gazebo bumperlinktopic not published

gazebo bumperlinktopic not published Hi, I am trying to add a bumper on baxter.urdf.xacro via the rethink_electric_gripp

2020-12-14 05:59:17 -0500 received badge  Popular Question (source)
2020-11-30 23:25:08 -0500 edited question how to set robot initial pose in rviz as gazebo spawner

how to make robot pose in rviz the same as it is in gazebo Hi, I am using the baxter robot to visualize it in gazebo and

2020-11-30 17:45:14 -0500 asked a question how to set robot initial pose in rviz as gazebo spawner

how to make robot pose in rviz the same as it is in gazebo Hi, I am using the baxter robot to visualize it in gazebo and

2020-11-26 04:31:40 -0500 received badge  Famous Question (source)
2020-10-16 20:24:49 -0500 received badge  Famous Question (source)
2020-10-15 23:26:28 -0500 received badge  Notable Question (source)
2020-10-15 23:26:28 -0500 received badge  Popular Question (source)
2020-10-15 11:17:46 -0500 edited question moveit setJointValueTarget() cannot execute

moveit setJointValueTarget() cannot execute Hi, I am using baxter and moveit to control the arm. The problem I met is th

2020-10-14 22:52:40 -0500 received badge  Organizer (source)
2020-10-14 22:22:32 -0500 edited question moveit setJointValueTarget() cannot execute

moveit setJointValueTarget() cannot execute Hi, I am using baxter and moveit to control the arm. The problem I met is th

2020-10-14 22:22:01 -0500 asked a question moveit setJointValueTarget() cannot execute

moveit setJointValueTarget() cannot execute Hi, I am using baxter and moveit to control the arm. The problem I met is th

2020-10-14 13:29:09 -0500 marked best answer Segmentation fault (core dumped)

I wrote a node but when I rosrun this node I got Segmentation fault (core dumped). Anyone can help? Thanks!

#include <ros/ros.h>
#include <csignal>
#include <iostream>

#include <arm_moveit/range_msg.h>
#include <gazebo_msgs/GetModelState.h>
#include <gazebo_msgs/ModelStates.h>
#include <geometry_msgs/Point.h>
const std::string TOPIC = "/gazebo/get_model_state";
const float TABLE_HEIGHT = 0.766;
const float TABLE_LENGTH = 2.0;
const float TABLE_WIDTH = 0.7;

class object_pose
{
private:
  ros::NodeHandle n;
  ros::Publisher range_publisher;
  ros::ServiceClient client;
  ros::Subscriber subsriber;
  geometry_msgs::Point tapping_range[2];
  arm_moveit::range_msg msg;

public:
  object_pose();
  ~object_pose();
  void callback(const gazebo_msgs::ModelStates::ConstPtr &robot_model_state);
  void connectServiceAndPublisher();
};
void object_pose::callback(const gazebo_msgs::ModelStates::ConstPtr &robot_model_state)
{
  ROS_INFO("callback function reached");
  geometry_msgs::Pose table_position;
  int table_index = -1;
  std::vector<std::string> model_names = robot_model_state->name;
  for (size_t i = 0; i < model_names.size(); i++)
  {
    if (model_names[i] == "table")
      table_index = i;
  }
  table_position = robot_model_state->pose[table_index];
  ROS_INFO_STREAM("Table Position:" << std::endl << table_position);
  // defines tapping starting point
  tapping_range[0].x = table_position.position.x + TABLE_WIDTH / 0.5f;
  tapping_range[0].y = table_position.position.y - TABLE_LENGTH / 0.5f;
  tapping_range[0].z = table_position.position.z + TABLE_HEIGHT;

  // defines tapping ending point
  tapping_range[1].x = table_position.position.x - TABLE_WIDTH / 0.5f;
  tapping_range[1].y = table_position.position.y + TABLE_LENGTH / 0.5f;
  tapping_range[1].z = table_position.position.z + TABLE_HEIGHT;

  ROS_INFO_STREAM("tapping_range:" << std::endl << tapping_range[0]);
  ROS_INFO_STREAM("tapping_range:" << std::endl << tapping_range[1]);
  msg.another_field = 2;
  msg.points.push_back(tapping_range[0]);
  msg.points.push_back(tapping_range[1]);
  range_publisher.publish(msg);

}
object_pose::object_pose()
{
}
void object_pose::connectServiceAndPublisher()
{
  range_publisher = n.advertise<arm_moveit::range_msg>("/tapping_range_topic", 1);
  object_pose obj;
  subsriber = n.subscribe("/gazebo/model_states", 1, &object_pose::callback, &obj);
}

object_pose::~object_pose()
{
}

int main(int argc, char **argv)
{
  ros::init(argc, argv, "object_pose");
  if (argc != 1)
  {
    ROS_INFO("usage: object_pose 'name'");
    return 1;
  }
  object_pose obj_pose;
  obj_pose.connectServiceAndPublisher();
  ros::spin();
  return 0;
}

range_msg.msg is defined as:

geometry_msgs/Point[] points
uint8 another_field

When I rosrun this node, I got:

[ INFO] [1602045185.242760021, 27.755000000]: callback function reached
[ INFO] [1602045185.243352804, 27.755000000]: Table Position:
position: 
  x: 1.1
  y: 0
  z: 0
orientation: 
  x: 0
  y: 0
  z: 0
  w: 1

[ INFO] [1602045185.243392476, 27.755000000]: tapping_range:
x: 2.5
y: -4
z: 0.766

[ INFO] [1602045185.243423741, 27.755000000]: tapping_range:
x: -0.3
y: 4
z: 0.766

Segmentation fault (core dumped)
2020-10-12 23:50:38 -0500 commented question Moveit plan not executed

find out that i need to run rosrun baxter_tools enable_robot.py -e

2020-10-12 18:38:16 -0500 received badge  Notable Question (source)
2020-10-12 18:09:04 -0500 edited question Moveit plan not executed

Moveit plan not executed I am using moveit and baxter to control the arm. In my left_arm_control_node, I found that I ca

2020-10-12 17:33:41 -0500 edited question Moveit plan not executed

Moveit plan not executed I am using moveit and baxter to control the arm. In my left_arm_control_node, I found that I ca

2020-10-12 17:31:58 -0500 asked a question Moveit plan not executed

Moveit plan not executed I am using moveit and baxter to control the arm. In my left_arm_control_node, I found that I ca

2020-10-12 16:49:27 -0500 commented answer Segmentation fault (core dumped)

Thanks a lot! This solves my problem

2020-10-12 16:48:54 -0500 received badge  Supporter (source)
2020-10-07 09:07:13 -0500 received badge  Popular Question (source)
2020-10-06 23:37:13 -0500 edited question Segmentation fault (core dumped)

Segmentation fault (core dumped) I wrote a node but when I rosrun this node I got Segmentation fault (core dumped). Anyo

2020-10-06 23:37:13 -0500 received badge  Editor (source)
2020-10-06 23:35:59 -0500 asked a question Segmentation fault (core dumped)

Segmentation fault (core dumped) I wrote a node but when I rosrun this node I got Segmentation fault (core dumped). Anyo

2020-09-21 22:08:22 -0500 received badge  Popular Question (source)
2020-09-07 21:37:33 -0500 edited question cannot echo rostopics published by gazebo

cannot echo rostopics published by gazebo I tried to attach a bumper on moveit setup assistant generated panda arm urdf

2020-09-07 21:37:03 -0500 asked a question cannot echo rostopics published by gazebo

cannot echo rostopics published by gazebo I tried to attach a bumper on moveit setup assistant generated panda arm urdf

2020-08-25 22:24:05 -0500 received badge  Famous Question (source)
2020-08-25 22:24:05 -0500 received badge  Notable Question (source)
2020-08-25 22:24:05 -0500 received badge  Popular Question (source)
2020-04-24 10:47:32 -0500 received badge  Enthusiast
2020-04-11 13:51:15 -0500 marked best answer ros client failed to get param

I was following ros beginner tutorials and trying to write a server and client to add elements in an array This is my my_params.yaml file

origin: [0, 0, 0, 0, 0]

My client.cpp is:

#include "ros/ros.h"
#include "exercise/ArraySum.h"
#include <cstdlib>

int main(int argc, char **argv)
{
  ros::init(argc, argv, "array_sum_client");
  ros::NodeHandle n;
  ros::ServiceClient client = n.serviceClient<exercise::ArraySum>("array_sum");
  exercise::ArraySum srv;
  int input[5];
  if(n.getParam("/origin",*input)) // get input from .yaml
{
 ROS_INFO("getParam");
}
else
{
 ROS_ERROR("Failed to get param 'origin'");
}
 for(int i = 0 ; i < 5 ; i++)
 {
  srv.request.a[i] = input[i]; // pass input data to server
 }
 // srv.request.a = atoll(argv[1]);
  if (client.call(srv))
  {
    ROS_INFO("Sum: %ld", (long int)srv.response.sum); // get result from server
  }
  else
  {
    ROS_ERROR("Failed to call service array_sum");
    return 1;
  }

  return 0;
}

My server.cpp is:

#include "ros/ros.h"
#include "exercise/ArraySum.h"

bool sumArray(exercise::ArraySum::Request  &req,
         exercise::ArraySum::Response &res)
{
int sum = 0;
for(int i = 0 ; i < 5 ; i++)
{  
sum += req.a[i];
ROS_INFO("request: x=%ld", (long int)req.a[i]);
}
res.sum = sum; 
ROS_INFO("sending back response: [%ld]", (long int)res.sum);
  return true;
}

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

  ros::ServiceServer service = n.advertiseService("array_sum", sumArray);
  ROS_INFO("Ready to add the array.");
  ros::spin();

  return 0;
}

And this is what I added to CMakeLists.txt

add_executable(array_sum_server src/array_sum_server.cpp)
target_link_libraries(array_sum_server ${catkin_LIBRARIES})
add_dependencies(array_sum_server exercise_gencpp)

add_executable(array_sum_client src/array_sum_client.cpp)
target_link_libraries(array_sum_client ${catkin_LIBRARIES})
add_dependencies(array_sum_client exercise_gencpp)

The command I am using is:

rparam load ./config/my_params.yaml
rosparam set /origin "[1, 1, 1, 1, 1]"

Then is I use rosparam list, I will get:

/origin
/rosdistro
/roslaunch/uris/host_sue_xps_15_7590__44833
/rosversion
/run_id

If I use rosparam get /, I will get:

origin: [1, 1, 1, 1, 1]
...

Then my command is:

 rosrun exercise array_sum_client

But I get a

[ERROR] [1586540531.965667007]: Failed to get param 'origin'

Also if I set paramerters like below instead of using rosparam set /origin "[1, 1, 1, 1, 1]":

rosrun exercise array_sum_client --ros-args -p "origin:=[2,2,2,2,2]"

I will get:

terminate called after throwing an instance of 'ros::InvalidNameException'
  what():  Character [[] is not valid as the first character in Graph Resource Name [[2,2,2,2,2]].  Valid characters are a-z, A-Z, / and in some cases ~.
Aborted (core dumped)

Does anyone have any idea of what's wrong with this? Thank you!

2020-04-11 13:51:15 -0500 received badge  Scholar (source)
2020-04-11 03:23:03 -0500 commented answer ros client failed to get param

Thanks it solves my problem! Regarding the command, I tried to use : rosrun exercise array_sum_client _origin:=[2,2,2,