Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit fc6a271

Browse files
committed
Preworking state
1 parent 2d63df7 commit fc6a271

2 files changed

Lines changed: 10 additions & 20 deletions

File tree

config/open_manipulator_x_robot_simulated_config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ robot_link_command_frame: link1 # commands must be given in the frame of a rob
1111
command_in_type: "unitless" # "unitless"> in the range [-1:1], as if from joystick. "speed_units"> cmds are in m/s and rad/s
1212
scale:
1313
# Scale parameters are only used if command_in_type=="unitless"
14-
linear: 0.4 # Max linear velocity. Meters per publish_period. Unit is [m/s]. Only used for Cartesian commands.
15-
rotational: 0.8 # Max angular velocity. Rads per publish_period. Unit is [rad/s]. Only used for Cartesian commands.
14+
linear: 1 # Max linear velocity. Meters per publish_period. Unit is [m/s]. Only used for Cartesian commands.
15+
rotational: 2 # Max angular velocity. Rads per publish_period. Unit is [rad/s]. Only used for Cartesian commands.
1616
# Max joint angular/linear velocity. Rads or Meters per publish period. Only used for joint commands on joint_command_in_topic.
17-
joint: 3
17+
joint: 1
1818

1919
## Properties of outgoing commands
2020
command_out_topic: /open_manipulator/joint_trajectory # Publish outgoing commands here

src/microros_moveit2servo_demo.cpp

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static const rclcpp::Logger LOGGER = rclcpp::get_logger("moveit_servo.servo_demo
5555
class ServoCppDemo
5656
{
5757
public:
58-
ServoCppDemo(rclcpp::Node::SharedPtr node) : node_(node), movement_mode_jog_(false)
58+
ServoCppDemo(rclcpp::Node::SharedPtr node) : node_(node), movement_mode_jog_(true)
5959
{
6060
// Create the planning_scene_monitor
6161
tf_buffer_ = std::make_shared<tf2_ros::Buffer>(node_->get_clock());
@@ -88,29 +88,19 @@ class ServoCppDemo
8888
{
8989
if(msg->transforms[0].child_frame_id == "/inertial_unit"){
9090
if(movement_mode_jog_){
91-
RCLCPP_INFO(LOGGER, "jog mode - TF: %f %f %f",msg->transforms[0].transform.rotation.x, msg->transforms[0].transform.rotation.y, msg->transforms[0].transform.rotation.z);
91+
// RCLCPP_INFO(LOGGER, "jog mode - TF: %f %f %f",msg->transforms[0].transform.rotation.x, msg->transforms[0].transform.rotation.y, msg->transforms[0].transform.rotation.z);
9292
auto msg_out = std::make_unique<control_msgs::msg::JointJog>();
9393
msg_out->header.stamp = node_->now();
9494

9595
msg_out->joint_names.push_back("joint1");
9696
msg_out->velocities.push_back(msg->transforms[0].transform.rotation.x*5);
97-
msg_out->displacements.push_back(msg->transforms[0].transform.rotation.x*5);
98-
99-
msg_out->joint_names.push_back("joint2");
100-
msg_out->velocities.push_back(-0.5);
101-
msg_out->displacements.push_back(0.0);
102-
103-
msg_out->joint_names.push_back("joint3");
104-
msg_out->velocities.push_back(0.0);
105-
msg_out->displacements.push_back(0.0);
10697

10798
msg_out->joint_names.push_back("joint4");
10899
msg_out->velocities.push_back(msg->transforms[0].transform.rotation.y*5);
109-
msg_out->displacements.push_back(msg->transforms[0].transform.rotation.x*5);
110100

111101
joint_cmd_pub_->publish(std::move(msg_out));
112102
}else{
113-
RCLCPP_INFO(LOGGER, "twist mode - TF: %f %f %f",msg->transforms[0].transform.rotation.x, msg->transforms[0].transform.rotation.y, msg->transforms[0].transform.rotation.z);
103+
// RCLCPP_INFO(LOGGER, "twist mode - TF: %f %f %f",msg->transforms[0].transform.rotation.x, msg->transforms[0].transform.rotation.y, msg->transforms[0].transform.rotation.z);
114104
auto msg_out = std::make_unique<geometry_msgs::msg::TwistStamped>();
115105
msg_out->header.stamp = node_->now();
116106
msg_out->header.frame_id = "link4";
@@ -184,12 +174,12 @@ int main(int argc, char** argv)
184174

185175
shape_msgs::msg::SolidPrimitive box;
186176
box.type = box.BOX;
187-
box.dimensions = { 0.1, 0.4, 0.1 };
177+
box.dimensions = { 0.1, 0.1, 0.1 };
188178

189179
geometry_msgs::msg::Pose box_pose;
190-
box_pose.position.x = 0.6;
191-
box_pose.position.y = 0.0;
192-
box_pose.position.z = 0.6;
180+
box_pose.position.x = 0.1;
181+
box_pose.position.y = 0;
182+
box_pose.position.z = 0;
193183

194184
collision_object.primitives.push_back(box);
195185
collision_object.primitive_poses.push_back(box_pose);

0 commit comments

Comments
 (0)